I use a shared webpack.config.js among projects and it uses the DefinePlugin to write some variables during build time - including process.env.NODE_ENV. I would also like to use dotenv-webpack so projects using the shared config can supply a .env for build time as well. If I use both plugins, however, I receive the error:
WARNING in DefinePlugin
Conflicting values for 'process.env'
I can make sure in DefinePlugin that process.env isn't used - except in some cases I need to write process.env.NODE_ENV at build time.
Instead, it would be preferable that dotenv-webpack simply merge with an existing process.env from DefinePlugin and overwrite any conflicts within.
I use a shared
webpack.config.jsamong projects and it uses theDefinePluginto write some variables during build time - includingprocess.env.NODE_ENV. I would also like to usedotenv-webpackso projects using the shared config can supply a.envfor build time as well. If I use both plugins, however, I receive the error:I can make sure in
DefinePluginthatprocess.envisn't used - except in some cases I need to writeprocess.env.NODE_ENVat build time.Instead, it would be preferable that
dotenv-webpacksimply merge with an existingprocess.envfrom DefinePlugin and overwrite any conflicts within.