0

A lot of warnings with webpack uglify

I've turned off warnings in UglifyJS, but I'm still getting a few warnings from webpack.

WARNING in main-0.2.8.js from UglifyJs
Dropping unused variable e [./~/bluebird/js/browser/bluebird.js:29,292]
Dropping unused variable o [./~/bluebird/js/browser/bluebird.js:29,292]
Dropping unused variable i [./~/bluebird/js/browser/bluebird.js:29,292]
Non-strict equality against boolean: == false [./~/aurelia-pal-browser/dist/commonjs/aurelia-pal-browser.js:200,0]
Non-strict equality against boolean: == false [./~/aurelia-pal-browser/dist/commonjs/aurelia-pal-browser.js:208,0]

Plugins from webpack.config

  plugins: [
    new AureliaWebpackPlugin(),
    new HtmlWebpackPlugin({
      title: 'Aurelia webpack skeleton - ' + pkg.version,
      template: 'index.prod.html',
      filename: 'index.html'
    }),
    new ProvidePlugin({
      $: 'jquery',
      jquery: 'jquery',
      "windows.jquery": 'jquery'
    }),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    })
  ]

If someone knows how to get rid of those last few warnings that would be nice.

Community
  • 1
  • 1
Saqib Rokadia
  • 629
  • 7
  • 16

1 Answers1

3

When you minimize throught UglifyJs, it warns you that it removes unused variables, and that it changes false values in !1 and true to !0. This is not a problem, it is only to reduce the file length. See also Javascript minification why is false replaced with !1 and true with !0. However, you may try to specify compression options to remove these warnings:

    compress: {
        warnings: false,
        booleans: false,
        unused: false
    }

For more information, see https://github.com/mishoo/UglifyJS2#compressor-options. I hope it helps.

Community
  • 1
  • 1
robisim74
  • 741
  • 4
  • 10