webpack 打包过程中出现 clean-webpack-plugin only accepts an options object 错误

clean-webpack-plugin 作用: 清除构建文件夹的 webpack 插件(也就是项目中 dist 文件夹工具)

如何造成这个错误: 版本升级导致 

// 笔者使用版本
 clean-webpack-plugin: ^2.0.1,

错误写法:

clean-webpack-plugin only accepts an options object

正确写法:

clean-webpack-plugin only accepts an options object

原因:  默认情况下,clean-webpack-plugin 将删除webpack的output.path目录中的所有文件,以及每次成功重建后所有未使用的webpack资产。

总结: 插件越升级越省事

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-01-06
  • 2021-11-19
  • 2022-12-23
  • 2021-08-07
相关资源
相似解决方案