fix(test): Processing access path (#88)

This commit is contained in:
xw 2021-11-23 13:08:30 +08:00 committed by GitHub
parent 19a0b4798e
commit 7080f1df40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 4 deletions

View File

@ -46,14 +46,14 @@ npm run build
## 测试 ## 测试
``` sh ``` sh
# 启动接口服务 # 启动模拟服务
npm run mm npm run mm
```
# 编译到 dist/md ``` sh
npm run build npm run build
# 访问 http://127.0.0.1:9000/md # 访问 http://127.0.0.1:9000/md
# 编译到 dist
npm run build:h5-netlify npm run build:h5-netlify
# 访问 http://127.0.0.1:9000/ # 访问 http://127.0.0.1:9000/
``` ```

17
mm.config.js Normal file
View File

@ -0,0 +1,17 @@
/**
* 配置说明请参考文档:
* https://hongqiye.com/doc/mockm/config/option.html
* @type {import('mockm/@types/config').Config}
*/
module.exports = {
static: [
{ // 测试 netlify 部署
fileDir: `./dist`,
path: `/`,
},
{ // 测试 gitee/github 部署
fileDir: `./dist`,
path: `/md`,
},
],
}

View File

@ -6,7 +6,7 @@
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build:h5-netlify": "cross-env SERVER_ENV=NETLIFY vue-cli-service build", "build:h5-netlify": "cross-env SERVER_ENV=NETLIFY vue-cli-service build",
"build": "vue-cli-service build", "build": "vue-cli-service build",
"mm": "npx mockm static=dist" "mm": "npx mockm"
}, },
"dependencies": { "dependencies": {
"@vue/shared": "^3.0.11", "@vue/shared": "^3.0.11",