how to read environment variables set by jenkins in react app

Viewed 354

I am using custom webpack configuration with dotenv and setting env variables using jenkins and docker. The problem is when I console.log process.env in react app.js it is giving me undefined.

This is the part of webpack config for dotenv.

new webpack.DefinePlugin({
   'process.env': JSON.stringify(dotenv.config().parsed)
})
0 Answers
Related