webpack-boilerplate icon indicating copy to clipboard operation
webpack-boilerplate copied to clipboard

Access environment variable

Open lorrod opened this issue 2 years ago • 1 comments

Hello! Could you please help to solve the issue with getting environment variable? I have tried to access via:

process.env.VARIABLE_NAME

but it seems that webpack is not configured to pass process variable, am I right? I am getting Can't find variable: process

Also I have tried to pass environment variable using web pack with no luck:

new webpack.DefinePlugin({
  'process.env.API_BASE_URL': JSON.stringify('https://api.example.com'),
})

lorrod avatar Mar 25 '23 09:03 lorrod

Hello. Let me think about correct way to pass user variables. It's a nice feature.

ArthurStam avatar Mar 26 '23 13:03 ArthurStam