0

webpack.common.js

optimization: {
  minimize: true, 
  minimizer: [
    new CssMinimizerPlugin({
      test: /\.foo\.css$/i,
      //or already used
      test: /\.css(\?.*)?$/i
    }),
  ],
},

any suggestion what the problem is?

Marik Ishtar
  • 2,899
  • 1
  • 13
  • 27

1 Answers1

2

This error is probably referring to

compilation.hooks.processAssets.tapPromise

You can use processAssets hook with Webpack versions higher than 5. css-minimizer-webpack-plugin migrated on processAssets hook since version 1.1.0.

Basically, there are two options to resolve this issue:

  • to lower version of css-minimizer-webpack-plugin to 1.0.0

     npm uninstall css-minimizer-webpack-plugin
    
     npm install css-minimizer-webpack-plugin@1.0.0
    

or

  • to upgrade webpack to higher than 5. If you're choosing this option, you probably want to research migration docs.
Mary
  • 166
  • 13