Answer the question
In order to leave comments, you need to log in
Wepback: why NODE_ENV environment variable is undefined?
Somehow I started to deal with webpack but a lot of work appeared and I left it. Now back to this, and almost immediately I had a problem with the NODE_ENV change. I look at the screencasts of I. Kantor, here is the webpack.config.js code:
'use strict';
const NODE_ENV = process.env.NODE_ENV || 'development';
const webpack = require('webpack');
module.exports = {
entry: './home',
output: {
filename: 'build.js',
library: 'home'
},
watch: NODE_ENV == 'development',
watchOptions: {
aggregateTimeout: 100
},
devtool: NODE_ENV == 'development' ? 'cheap-inline-module-source-map' : null,
plugins: [
new webpack.EnvironmentPlugin('NODE_ENV', 'USER')
]
};
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