Home

Issue: 216

ERROR in server-bundle.js from UglifyJs

[issue link]
ERROR in server-bundle.js from UglifyJs
SyntaxError: Unexpected token punc «)», expected punc «(» [server-bundle.js:194,13]
Webpack build exited with errors
error Command failed with exit code 1.

nuxt.config.js:

build: {
  extend (config, { dev }) {
    if (!dev) {
      config.devtool = false
      config.plugins.push(
        new webpack.optimize.UglifyJsPlugin({
          parse: {
            strict: true
          },
          compress: {
            unsafe: true,
            warnings: false,
            drop_console: true
          },
          output: {
            comments: false,
            ascii_only: true,
            inline_script: true
          },
          mangle: true
        })
      )
    }
  }
}

How to fix it ? 😦

This question is available on Nuxt.js community (#c186)