Answer the question
In order to leave comments, you need to log in
Why is NODE_ENV not working?
Hey! Recently started to understand webpack. I saw about such a thing as "process.env.NODE_ENV" .
I write to the console
webpack --define process.env.NODE_ENV="development"
console.log(process.env.NODE_ENV);
displays undefinedwebpack NODE_ENV="development"
webpack env.NODE_ENV="development"
SET NODE_ENV="development"
webpack
Answer the question
In order to leave comments, you need to log in
First you need to define an environment variable:
NODE_ENV=development webpack --config webpack.config.js
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question