File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export class MockCompiler extends EventEmitter {
4646 return this . _mockData
4747 }
4848
49- run ( ) : void {
49+ run ( watch ?: boolean ) : void {
5050 const { include, exclude } = this . options
5151 /**
5252 * 使用 rollup 提供的 include/exclude 规则,
@@ -68,6 +68,9 @@ export class MockCompiler extends EventEmitter {
6868 . then ( loadList => promiseParallel ( loadList , 10 ) )
6969 . then ( ( ) => this . updateMockList ( ) )
7070
71+ if ( ! watch )
72+ return
73+
7174 this . watchMockEntry ( )
7275 this . watchDeps ( )
7376
Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ export function mockServerMiddleware(
2323 */
2424 const compiler = createMockCompiler ( options )
2525
26- compiler . run ( )
26+ compiler . run ( ! ! server )
2727
2828 /**
2929 * 监听 mock 文件是否发生变更,如何配置了 reload 为 true,
You can’t perform that action at this time.
0 commit comments