1、安装clean-webpack-plugin插件

npm install clean-webpack-plugin --D

2、在webpack.dev.conf.js或者webpack.config.js下引入该模块, 并在plugins中进行配置

//引入模块
const cleanWebpackPlugin = require('clean-webpack-plugin');
//在plugins中进行配置
plugins: [
    new cleanWebpackPlugin(['dist']) //清理dist文件夹
]

3、重启项目即可

 

相关文章:

  • 2022-01-16
  • 2021-06-27
  • 2022-12-23
  • 2021-09-21
  • 2021-08-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-20
  • 2021-07-23
  • 2022-12-23
  • 2021-11-23
  • 2021-10-25
  • 2021-06-06
相关资源
相似解决方案