How can i get / access webpack ENV (process.env) variables during process time (not runtime in browser) ? the webpack.DefinePlugin(…) doesn’t seem to work in html files, i don’t have access to ENV variables in the main index.html
any solution ? is it normal ?
I’m assuming you’re using something like HtmlWebpackPlugin since you reference process (build?) time, not runtime. To work around similar issues, I’ve configured my plugin like:
or replace with any other boolean logic if your DefinePlugin assignment doesn’t match the build time env.
Then in my HTML template I’ll do something like:
P.S. Webpack uses github issues for tracking bugs in webpack. For questions like this, please use StackOverflow.