H
H
hellcaster2019-05-15 18:53:11
Node.js
hellcaster, 2019-05-15 18:53:11

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"

But when I write it console.log(process.env.NODE_ENV);displays undefined
Why and how to use NODE_ENV correctly?
PS In the console I wrote not only the above representations option, but also
webpack 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

1 answer(s)
E
Eduard Shkuta, 2019-05-15
@web_Developer_Victor

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 question

Ask a Question

731 491 924 answers to any question