perf: import mockXHR only in production (#2910)
* 自动排除mock 生产环境,使用webpack的条件编译自动排除mock数据 * perf: refine Co-authored-by: 花裤衩 <panfree23@gmail.com>
This commit is contained in:
parent
4f563a7bfe
commit
a0b39d5043
|
@ -25,11 +25,12 @@ import * as filters from './filters' // global filters
|
||||||
* you can execute: mockXHR()
|
* you can execute: mockXHR()
|
||||||
*
|
*
|
||||||
* Currently MockJs will be used in the production environment,
|
* 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') {
|
if (process.env.NODE_ENV === 'production') {
|
||||||
|
import('../mock').then(({ mockXHR }) => {
|
||||||
mockXHR()
|
mockXHR()
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
Vue.use(Element, {
|
Vue.use(Element, {
|
||||||
|
|
Loading…
Reference in New Issue