oliviertassinari / serviceworker-webpack-plugin

Simplifies creation of a service worker to serve your webpack bundles. :recycle:
https://oliviertassinari.github.io/serviceworker-webpack-plugin/
MIT License
458 stars 76 forks source link

Minimizing errors with UglisyJsPlugin #89

Closed GabrielGil closed 6 years ago

GabrielGil commented 6 years ago

Bug Report or Feature Request (mark with an x)

- [ x ] bug report
- [ ] feature request

Versions.

browser: N/A
browser version: N/A
operating system: MacOS 10.14
webpack version: 4.20

Repro steps.

Building the app with the new optimization configuration does not work properly with this plugin. I am using Babel 8 in the rest of the app with no problems.

{
  optimization: {
    minimizer: [
      new UglifyJsPlugin({
        cache: true,
        parallel: true,
        sourceMap: true,
      })
    ],
  },
}

Desired or expected functionality

Not to crash :P

Mention any other details that might be useful.

ERROR in sw.js from UglifyJs
Unexpected token: keyword (const) [./app/sw.js:4,0][sw.js:94,0]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! octavo-store@0.1.0 build: `webpack --config webpack.prod.js`
GabrielGil commented 6 years ago

Problem solved (by paying attention to release notes :P ): UglifyJS does not support ES6 anymore from 2.0 as per the release notes. https://github.com/webpack-contrib/uglifyjs-webpack-plugin/releases/tag/v2.0.0