terser - unexpected prop in webpack config
andrejcremoznik opened this issue · comments
Andrej Cremoznik commented
This issue is a:
- Bug report
Description
Adding terser
to nwb.config.js
produces:
✖ webpack = 'terser'
Unexpected prop in webpack config - see https://github.com/insin/nwb/blob/master/docs/Configuration.md#webpack-configuration for supported config. If you were trying to add extra Webpack config, try putting it in webpack.extra instead
Example nwb.config.js
:
module.exports = {
type: 'react-component',
npm: {
cjs: false,
esModules: false,
umd: { global: 'thing' }
},
webpack: {
terser: { sourceMap: false }
}
}
Maybe the documentation is outdated? I don't think using webpack.extra
here is the right thing.
My environment
nwb
installed globally- versions:
nwb v0.23.0 node v11.15.0 npm 6.9.0
- modules:
├── nwb-sass@0.9.0 ├── react@16.8.6 ├── react-dom@16.8.6 └── svg-inline-loader@0.8.0
Mateusz Paś commented
Any changes?
Findlay Hannam commented
I'm still seeing this
Chaos commented
Here is the correct configuration
webpack: {
uglify: {
sourceMap: false
}
}
https://github.com/insin/nwb/blob/v0.23.0/docs/Configuration.md#uglify-object--false
Jonny Buchanan commented
terser
config is new and uglify
is deprecated as of v0.24.0