I'm trying to add a global constant to my project. For this I use webpack.DefinePlugin. This works if I add one in the module.exports. I fail to do this conditionally however. In the config below I'm able to use the __VERSION__ constant in my module after declaring it like so: declare var __VERSION__: string;. If I try to use __VERSION2__ or __VERSION3__ I get an error in the console ReferenceError: __VERSION3__ is not defined. If my understanding is correct this should have been replaced. Does this mean that the conditional part is not executed or not executed correctly? How can I debug this? Or even better, how can I fix this?
Note: the intention is to switch a url based on development or production build.