-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
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
.
I'm using:
"webpack": "^3.9.1",
"webpack-conditional-loader": "^1.0.11",
Metadata
Metadata
Assignees
Labels
No labels