Why is the environment variable process.env.NODE_ENV?

In his webpack.config.js there is 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'"
}
})
])
}

In vue template:
created() {
this.$store.dispatch('GET_LEVELS')
this.$store.dispatch('GET_USERLEVELS')
 console.log(process.env.NODE_ENV, '<------------NODE_ENV', process.env)
 },

I get undefined. How to fix this?
March 23rd 20 at 19:26
0 answer

Find more questions by tags Vue.jsWebpack