Skip to content

Commit

Permalink
NODE_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangmrit committed Sep 20, 2019
1 parent 4c9d899 commit 41758dd
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NODE_ENV=development
VUE_APP_PREVIEW=true
VUE_APP_API_BASE_URL=/api
2 changes: 1 addition & 1 deletion src/layouts/RouteView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
// 这里增加了 multiTab 的判断,当开启了 multiTab 时
// 应当全部组件皆缓存,否则会导致切换页面后页面还原成原始状态
// 若确实不需要,可改为 return meta.keepAlive ? inKeep : notKeep
if (!getters.multiTab && !!meta.keepAlive) {
if (!getters.multiTab && !meta.keepAlive) {
return notKeep
}
return this.keepAlive || getters.multiTab || meta.keepAlive ? inKeep : notKeep
Expand Down
2 changes: 1 addition & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const vueConfig = {
}

// 如果你不想在生产环境开启换肤功能,请打开下面注释
// if (process.env.NODE_ENV !== 'production' || process.env.VUE_APP_PREVIEW === 'true') {
// if (process.env.VUE_APP_PREVIEW === 'true') {
// add `ThemeColorReplacer` plugin to webpack plugins
vueConfig.configureWebpack.plugins.push(createThemeColorReplacerPlugin())
// }
Expand Down
17 changes: 2 additions & 15 deletions webstorm.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
'use strict'
const path = require('path')

function resolve (dir) {
return path.join(__dirname, '.', dir)
}

module.exports = {
context: path.resolve(__dirname, './'),
resolve: {
extensions: ['.js', '.vue', '.json'],
alias: {
'@': resolve('src')
}
}
}
const webpackConfig = require('@vue/cli-service/webpack.config.js')
module.exports = webpackConfig

0 comments on commit 41758dd

Please sign in to comment.