網站首頁 編程語言 正文
webpack-plugins: plugin的使用 clean-webpack-plugin CleanWebpackPlugin
作者:小強有個dream 更新時間: 2022-04-04 編程語言Usage 用法
NOTE: Node v10+ and webpack v4+ are supported and tested.
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
plugins: [
new CleanWebpackPlugin()
],
};
關于
默認情況下,該插件將刪除網頁包輸出中的所有文件。路徑目錄,以及每次成功重建后所有未使用的網頁包資產
options
dry 模擬刪除
verbose 將日志寫入控制臺
cleanStaleWebpackAssets 重建時自動刪除所有未使用的網頁包資產
protectWebpackAssets 不允許刪除當前的網頁包資產
cleanOnceBeforeBuildPatterns 在編譯網頁包之前刪除一次文件
cleanAfterEveryBuildPatterns 每次生成(包括監視模式)后刪除與此模式匹配的文件。
dangerouslyAllowCleanPatternsOutsideProject 需要顯式設置dry選項
報錯
clean-webpack-plugin: options.output.path not defined. Plugin disabled…
解決
/webpack.config.js
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
output: {
path: __dirname + '/dist'
},
plugins: [
new CleanWebpackPlugin()
]
}
原文鏈接:https://blog.csdn.net/qq_36413371/article/details/123520498
相關推薦
- 2022-05-19 redis擊穿?雪崩?穿透超詳細解決方案梳理_Redis
- 2023-07-29 使用 XMLHttpRequest 實現 ajax
- 2023-03-21 Golang使用Gin創建Restful?API的實現_Golang
- 2023-01-20 Django如何實現RBAC權限管理_python
- 2022-08-21 使用?DataAnt?監控?Apache?APISIX的原理解析_Linux
- 2022-07-10 修改redo默認傳輸用戶sys到其他---redo_transport_user參數
- 2022-09-27 linux?shell中Grep命令查找多個字符串(grep同時匹配多個關鍵字或任意關鍵字)_lin
- 2022-08-16 QT布局管理詳解QVBoxLayout與QHBoxLayout及QGridLayout的使用_C 語
- 最近更新
-
- window11 系統安裝 yarn
- 超詳細win安裝深度學習環境2025年最新版(
- Linux 中運行的top命令 怎么退出?
- MySQL 中decimal 的用法? 存儲小
- get 、set 、toString 方法的使
- @Resource和 @Autowired注解
- Java基礎操作-- 運算符,流程控制 Flo
- 1. Int 和Integer 的區別,Jav
- spring @retryable不生效的一種
- Spring Security之認證信息的處理
- Spring Security之認證過濾器
- Spring Security概述快速入門
- Spring Security之配置體系
- 【SpringBoot】SpringCache
- Spring Security之基于方法配置權
- redisson分布式鎖中waittime的設
- maven:解決release錯誤:Artif
- restTemplate使用總結
- Spring Security之安全異常處理
- MybatisPlus優雅實現加密?
- Spring ioc容器與Bean的生命周期。
- 【探索SpringCloud】服務發現-Nac
- Spring Security之基于HttpR
- Redis 底層數據結構-簡單動態字符串(SD
- arthas操作spring被代理目標對象命令
- Spring中的單例模式應用詳解
- 聊聊消息隊列,發送消息的4種方式
- bootspring第三方資源配置管理
- GIT同步修改后的遠程分支