i want to add custom environment variables when using react-boilerplate. In my DEV environment i will point the API to my localhost backend, but in PROD environment i will point it to the PROD backend. I have tried using dotenv-webpack and react-scripts but still won't work. for the dotenv-webpack i have add the plugins code below dllPlugin.
dllPlugin: {
...
},
plugins: [
new Dotenv({
path: './.env', // Path to .env file (this is the default)
systemvars: true,
safe: true // load .env.example (defaults to "false" which does not use dotenv-safe)
})
]
...
anyone have succeed applying this feature ? please throw some enlightment..