From 7080f1df403a53a7083cc31ee7017a74c8939b0f Mon Sep 17 00:00:00 2001 From: xw Date: Tue, 23 Nov 2021 13:08:30 +0800 Subject: [PATCH] fix(test): Processing access path (#88) --- README.md | 6 +++--- mm.config.js | 17 +++++++++++++++++ package.json | 2 +- 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 mm.config.js diff --git a/README.md b/README.md index 6d20031..9ff900e 100644 --- a/README.md +++ b/README.md @@ -46,14 +46,14 @@ npm run build ## 测试 ``` sh -# 启动接口服务 +# 启动模拟服务 npm run mm +``` -# 编译到 dist/md +``` sh npm run build # 访问 http://127.0.0.1:9000/md -# 编译到 dist npm run build:h5-netlify # 访问 http://127.0.0.1:9000/ ``` diff --git a/mm.config.js b/mm.config.js new file mode 100644 index 0000000..416e41d --- /dev/null +++ b/mm.config.js @@ -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`, + }, + ], +} diff --git a/package.json b/package.json index ca51216..9dddc7c 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "serve": "vue-cli-service serve", "build:h5-netlify": "cross-env SERVER_ENV=NETLIFY vue-cli-service build", "build": "vue-cli-service build", - "mm": "npx mockm static=dist" + "mm": "npx mockm" }, "dependencies": { "@vue/shared": "^3.0.11",