提交 a0b39d50 编写于 作者: 任羽飞 提交者: 花裤衩

perf: import mockXHR only in production (#2910)

* 自动排除mock

生产环境,使用webpack的条件编译自动排除mock数据

* perf: refine
Co-authored-by: N花裤衩 <panfree23@gmail.com>
上级 4f563a7b
......@@ -25,11 +25,12 @@ import * as filters from './filters' // global filters
* 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') {
mockXHR()
import('../mock').then(({ mockXHR }) => {
mockXHR()
})
}
Vue.use(Element, {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册