I would like to deploy my app (using javaScriptServices) for production. In my webpack.config I have added this code:
...
var API_URL = {
development: JSON.stringify('devApiUrl'),
production: JSON.stringify('prodApiUrl')
}
...
var environment = process.env.NODE_ENV === 'production'?'production':'development';
...
plugins: [
new webpack.DefinePlugin({'API_URL': API_URL[environment]})
]
...
Then in my code, everywhere API_URL is found is replaced for it's actual value(eg: devApiUrl ), so far so good. I am deploying my app to an Azure App Service, but always, the API_URL is set for development, and I do not know how to change NODE_ENV. I did create a variable in the Azure service called NODE_ENV and have setted to 'production', but did not work. Can someone help me?