rubystarashe / nuxt-vuex-localstorage

MIT License
161 stars 18 forks source link

Error from UglifyJS #4

Closed travis-r6s closed 5 years ago

travis-r6s commented 5 years ago

When using this plugin, and with extended webpack config, I get the below error:

ERROR in 70638b2044f7882b0a1c.js from UglifyJs
Invalid assignment [./node_modules/nuxt-vuex-localstorage/plugins/bindStorage/expire.js:2,18][70638b2044f7882b0a1c.js:18593,20]

 FATAL  Nuxt Build Error                                                      16:46:16

  at WebpackBundler.webpackCompile (node_modules/@nuxt/webpack/dist/webpack.js:5263:15)

My nuxt.config.js;

build: {
    extractCSS: true,
    optimization: {
      minimizer: [
        new UglifyJsPlugin({
          cache: true,
          parallel: true,
          sourceMap: true
        }),
        new OptimizeCssAssetsPlugin({})
      ],
      splitChunks: {
        cacheGroups: {
          styles: {
            name: 'styles',
            test: /\.(vue)$/,
            chunks: 'all',
            enforce: true
          }
        }
      }
    },
...
travis-r6s commented 5 years ago

Never mind. I used Nuxt's built-in optimization (instead of UglifyJ SPlugin), and all was fine.