Reputation: 53850
I have a set of files that are compiled into a bundle file. The frontend code is in its own repository and I have some information about it when building the bundle.
I want to put that information into my bundle so that it's accessible from the code, like
App.Env = 'development'
then access it like this:
if (App.Env === 'development') {
Api.Url = 'http://stating.example.com'
}
Upvotes: 0
Views: 26
Reputation: 16472
You can use define webpack plugin. https://github.com/webpack/docs/wiki/list-of-plugins#defineplugin
Upvotes: 1