, npm run build package error after upgrading from vue webpack to webpack4

, npm run build package error after upgrading from vue webpack to webpack4

hand disability, upgrade webpack to 4, development environment adjusted, normal operation, production environment, packaging problems, Baidu, google did not find a solution.

report an error as shown in the following figure

webpack.prod.conf.js changed

  optimization: {
    runtimeChunk: {
      name: "manifest"
    },
    minimizer: [
      new UglifyJsPlugin({
        cache: true,
        parallel: true,
        sourceMap: config.build.productionSourceMap,
        uglifyOptions: {
          warnings: false
        }
      }),
      new OptimizeCSSPlugin({
        cssProcessorOptions: config.build.productionSourceMap
          ? { safe: true, map: { inline: false } }
          : { safe: true }
      }),
    ],
    splitChunks:{
      chunks: "async",
      minSize: 30000,
      minChunks: 1,
      maxAsyncRequests: 5,
      maxInitialRequests: 3,
      name: false,
      cacheGroups: {
        vendor: {
          name: "vendor",
          chunks: "initial",
          priority: -10,
          reuseExistingChunk: false,
          test: /node_modules\/(.*)\.js/
        },
        styles: {
          name: "styles",
          test: /\.(scss|css)$/,
          chunks: "all",
          minChunks: 1,
          reuseExistingChunk: true,
          enforce: true
        }
      }
    }
  },
Nov.26,2021

landlord, it should be the version. Take a look at this, portal . I hope it will be of some help to you.

npm i -D extract-text-webpack-plugin@next
Menu