From 32adc9846849b9091a0dfe1087b90c1d45b9ab4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=98chen=2Ehome=E2=80=99?= <1147347984@qq.com> Date: Sun, 7 Aug 2022 22:56:42 +0800 Subject: [PATCH] =?UTF-8?q?fix(projects):=20=E4=BF=AE=E5=A4=8Dmock?= =?UTF-8?q?=E7=94=9F=E4=BA=A7=E7=8E=AF=E5=A2=83=E6=95=B0=E6=8D=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/plugins/mock.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/build/plugins/mock.ts b/build/plugins/mock.ts index c4be5eb..92947cc 100644 --- a/build/plugins/mock.ts +++ b/build/plugins/mock.ts @@ -1,7 +1,9 @@ -import { viteMockServe } from 'vite-plugin-mock'; +import { viteMockServe } from 'vite-plugin-mock'; // https://github.com/vbenjs/vite-plugin-mock/blob/main/README.zh_CN.md export default viteMockServe({ mockPath: 'mock', - watchFiles: true, // 监视文件更改 - // localEnabled: command === 'serve', + injectCode: ` + import { setupMockServer } from '../mock'; + setupMockServer(); + `, });