Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
自动排除mock
生产环境,使用webpack的条件编译自动排除mock数据
  • Loading branch information
MillerRen authored Jan 6, 2020
commit 81db6b876f69d9fe667bcc8ed88f55a156cc9b56
4 changes: 1 addition & 3 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ import * as filters from './filters' // global filters
* you want to use MockJs for mock api
* you can execute: mockXHR()
*
* Currently MockJs will be used in the production environment,
* please remove it before going online! ! !
*/
import { mockXHR } from '../mock'
if (process.env.NODE_ENV === 'production') {
const { mockXHR } = require('../mock').default
mockXHR()
}

Expand Down