Skip to content

Commit 81db6b8

Browse files
authored
自动排除mock
生产环境,使用webpack的条件编译自动排除mock数据
1 parent 4f563a7 commit 81db6b8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ import * as filters from './filters' // global filters
2424
* you want to use MockJs for mock api
2525
* you can execute: mockXHR()
2626
*
27-
* Currently MockJs will be used in the production environment,
28-
* please remove it before going online! ! !
2927
*/
30-
import { mockXHR } from '../mock'
3128
if (process.env.NODE_ENV === 'production') {
29+
const { mockXHR } = require('../mock').default
3230
mockXHR()
3331
}
3432

0 commit comments

Comments
 (0)