Answer the question
In order to leave comments, you need to log in
Why can't I get the process.env.NODE_ENV environment variable?
In my webpack.config.js I have this:
if (process.env.NODE_ENV === 'development') {
module.exports.devtool = '#source-map'
module.exports.plugins = (module.exports.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"development"',
ENDPOINT: '"http://localhost:8000"',
FOO: "'hello world'"
}
})
])
}
created() {
this.$store.dispatch('GET_LEVELS')
this.$store.dispatch('GET_USERLEVELS')
console.log(process.env.NODE_ENV, ' <------------NODE_ENV', process.env)
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question