We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This is my webpack configuration:
rules: [ { test: /\.jsx?$/, exclude: [/node_modules/], loader: ['babel-loader', 'webpack-conditional-loader'] } ], plugins: [ new webpack.EnvironmentPlugin({ NODE_ENV: 'production', BROWSER: true }), ]
Then, in my file I use this:
// #if process.env.NODE_ENV !== 'production' import moment from 'moment'; // #endif
The moment library is still imported.
It works only if I do:
// #if process.env.NODE_ENV === 'anything_other_value' import moment from 'moment'; // #endif
This means, the process.env.NODE_ENV is undefined.
process.env.NODE_ENV
undefined
I'm using: "webpack": "^3.9.1", "webpack-conditional-loader": "^1.0.11",
The text was updated successfully, but these errors were encountered:
Just define NODE_ENV as environment variable before call webpack
Sorry, something went wrong.
No branches or pull requests
This is my webpack configuration:
Then, in my file I use this:
The moment library is still imported.
It works only if I do:
This means, the
process.env.NODE_ENV
isundefined
.I'm using:
"webpack": "^3.9.1",
"webpack-conditional-loader": "^1.0.11",
The text was updated successfully, but these errors were encountered: