Browse Source

perf: import mockXHR only in production

花裤衩 5 years ago
parent
commit
d4c29f903f
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/main.js

+ 2 - 2
src/main.js

@@ -21,10 +21,10 @@ import '@/permission' // permission control
21
  * you can execute: mockXHR()
21
  * you can execute: mockXHR()
22
  *
22
  *
23
  * Currently MockJs will be used in the production environment,
23
  * Currently MockJs will be used in the production environment,
24
- * please remove it before going online! ! !
24
+ * please remove it before going online ! ! !
25
  */
25
  */
26
-import { mockXHR } from '../mock'
27
 if (process.env.NODE_ENV === 'production') {
26
 if (process.env.NODE_ENV === 'production') {
27
+  const { mockXHR } = require('../mock')
28
   mockXHR()
28
   mockXHR()
29
 }
29
 }
30
 
30