perf: import mockXHR only in production (#2910)
* 自动排除mock 生产环境,使用webpack的条件编译自动排除mock数据 * perf: refine Co-authored-by: 花裤衩 <panfree23@gmail.com>pull/3036/head
							parent
							
								
									4339504db2
								
							
						
					
					
						commit
						1d707e4ab6
					
				|  | @ -26,11 +26,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, { | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	 任羽飞
						任羽飞