Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
If you are using webpack you can use webpackDefinePlugin
For example:
new webpack.DefinePlugin({
'ENV_API_ROOT_V1': JSON.stringify(process.env.ENV_API_ROOT_V1),
'HTTP_PROTOCOL': JSON.stringify(process.env.HTTP_PROTOCOL),
'WS_PROTOCOL': JSON.stringify(process.env.WS_PROTOCOL),
}),
You can add them to the global window object, or create a json object in the template and parse it or get it via Ajax
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question