Files
vue-cli/packages/@vue/cli-service/lib/util/resolveClientEnv.js
Haoqun Jiang f5a1950fd2 refactor!: use EnvironmentPlugin instead of DefinePlugin (#3782)
BREAKING CHANGE:
This change breaks use cases where users have tapped the `define`
plugin options in `chainWebpack`

fixes #3579
2019-04-30 10:17:40 +08:00

14 lines
300 B
JavaScript

const prefixRE = /^VUE_APP_/
module.exports = function resolveClientEnv (options, raw) {
const env = {}
Object.keys(process.env).forEach(key => {
if (prefixRE.test(key) || key === 'NODE_ENV') {
env[key] = process.env[key]
}
})
env.BASE_URL = options.publicPath
return env
}