ソースを参照

perf: import mockXHR only in production

花裤衩 5 年 前
コミット
d4c29f903f
共有1 個のファイルを変更した2 個の追加2 個の削除を含む
  1. 2 2
      src/main.js

+ 2 - 2
src/main.js

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