insin / nwb

A toolkit for React, Preact, Inferno & vanilla JS apps, React libraries and other npm modules for the web, with no configuration (until you need it)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

terser - unexpected prop in webpack config

andrejcremoznik opened this issue · comments

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

  1. nwb installed globally
  2. versions:
    nwb v0.23.0
    node v11.15.0
    npm 6.9.0
    
  3. modules:
    ├── nwb-sass@0.9.0
    ├── react@16.8.6
    ├── react-dom@16.8.6
    └── svg-inline-loader@0.8.0
    

Any changes?

I'm still seeing this

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

terser config is new and uglify is deprecated as of v0.24.0