Skip to content

Commit

Permalink
增加NoMock构建模式
Browse files Browse the repository at this point in the history
  • Loading branch information
han-feng committed Nov 14, 2018
1 parent 49248fe commit 5927d26
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .env.nomock
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# No Mock 构建

# 指定构建模式
NODE_ENV=production

# 标记当前是 No Mock 构建
VUE_APP_BUILD_MODE=nomock
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"start": "npm run serve",
"dev": "npm run serve",
"build": "vue-cli-service build",
"build:nomock": "vue-cli-service build --mode nomock",
"build:travis": "vue-cli-service build --mode travis",
"lint": "vue-cli-service lint --fix",
"test:unit": "vue-cli-service test:unit"
Expand Down
2 changes: 0 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import Vue from 'vue'
import App from './App'
// store
import store from '@/store/index'
// 模拟数据
import '@/mock'
// 多国语
import i18n from './i18n'
// 核心插件
Expand Down
6 changes: 6 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,11 @@ module.exports = {
entry
.add('babel-polyfill')
.end()
if (process.env.VUE_APP_BUILD_MODE !== 'nomock') {
// 加入模拟数据
entry
.add('@/mock')
.end()
}
}
}

0 comments on commit 5927d26

Please sign in to comment.