process.env in webpack on Azure #156

Closed
opened 2025-08-09 17:15:12 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @marcinwenger on 2/23/2018

Hi,

I'm trying to access Node's env variables as follows inside webpack.config.js. I've set CMS_API_URL in Application Settings in Azure but webpack doesn't seem to be reading those values.

Both process.env.TEST_API and process.env.TEST_API_2 inside my project are undefined

plugins: [
new webpack.DefinePlugin({
'process.env': {
TEST_API: JSON.stringify(process.env.CMS_API_URL),
TEST_API_2: JSON.stringify(process.env.APPSETTINGS_CMS_API_URL)
}
})
]

Is it at all possible to access Azure's app settings inside webpack?

Thanks

*Originally created by @marcinwenger on 2/23/2018* Hi, I'm trying to access Node's env variables as follows inside webpack.config.js. I've set CMS_API_URL in Application Settings in Azure but webpack doesn't seem to be reading those values. Both process.env.TEST_API and process.env.TEST_API_2 inside my project are `undefined` `plugins: [` ` new webpack.DefinePlugin({` ` 'process.env': {` ` TEST_API: JSON.stringify(process.env.CMS_API_URL),` ` TEST_API_2: JSON.stringify(process.env.APPSETTINGS_CMS_API_URL)` ` }` ` })` ` ]` Is it at all possible to access Azure's app settings inside webpack? Thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#156
No description provided.