Skip to content

Commit fb3f922

Browse files
committed
chore: vue config NODE_ENV
1 parent 129e811 commit fb3f922

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

β€Ž.env.development

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
NODE_ENV=development
2+
VUE_APP_PREVIEW=true
3+
VUE_APP_API_BASE_URL=/api

β€Žvue.config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function resolve (dir) {
1111
* @returns {boolean}
1212
*/
1313
function isProd () {
14-
return process.env.NODE_ENV === 'production' || process.env.VUE_APP_PREVIEW === 'true'
14+
return process.env.NODE_ENV === 'production'
1515
}
1616

1717
const assetsCDN = {
@@ -111,7 +111,8 @@ const vueConfig = {
111111
}
112112

113113
// preview.pro.loacg.com only do not use in your production;
114-
if (!isProd()) {
114+
if (process.env.VUE_APP_PREVIEW === 'true') {
115+
console.log('VUE_APP_PREVIEW', true)
115116
// add `ThemeColorReplacer` plugin to webpack plugins
116117
vueConfig.configureWebpack.plugins.push(createThemeColorReplacerPlugin())
117118
}

β€Žwebstorm.config.js

+2-15
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
11
'use strict'
2-
const path = require('path')
3-
4-
function resolve (dir) {
5-
return path.join(__dirname, '.', dir)
6-
}
7-
8-
module.exports = {
9-
context: path.resolve(__dirname, './'),
10-
resolve: {
11-
extensions: ['.js', '.vue', '.json'],
12-
alias: {
13-
'@': resolve('src')
14-
}
15-
}
16-
}
2+
const webpackConfig = require('@vue/cli-service/webpack.config.js')
3+
module.exports = webpackConfig

0 commit comments

Comments
Β (0)