Upgrade from Webpack 4 to Webpack 5 with LimitChunkSizePlugin

Viewed 131

I have an vue 2 application with webpack 4 that I wanted to upgrade to webpack 5. I'm using the LimitChunkSizePlugin as below in my vue.config.js (configuration section of webpack is included within this file.)

    }
  },
  plugins : [
    new webpack.optimize.LimitChunkCountPlugin({
      maxChunks: 1,
    }),
  ]
};

This code is causing the build to fail as below :

.../node_modules/webpack/lib/util/comparators.js:39
                map.set(arg, result);
                    ^

TypeError: Invalid value used as weak map key
    at WeakMap.set (<anonymous>)
    at .../node_modules/webpack/lib/util/comparators.js:39:7
    at .../node_modules/webpack/lib/optimize/LimitChunkCountPlugin.js:79:37
    ...

do you have any idea about this ? I was looking at this : https://webpack.js.org/plugins/limit-chunk-count-plugin/ but there is no mention whatsoever of such problem.

Thanks for your help in advance.

0 Answers
Related