I am trying to set a flag that tells my code whether it is in production or development. So far I have seen:
In the VS code launch.json:
{ "configurations": { "env": "NODE_ENV": "development" } }
In Node package.json:
{ "scripts": { "start": "NODE_ENV=production" } }
In webpack webpack.config.js:
module.exports = { "plugins": new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"' }) }
When running the code:
set NODE_ENV=production && node app
NPM packages:
https:
Powershell:
$env:NODE_ENV="production"
I think I'm just confused, because by default I have about 4 of these sets. How exactly do they interact? Do they all refer to the same variable? Should I have only one of them? Which of them overwrite the rest?
, , , , , . , , ?