網站首頁 編程語言 正文
clean-webpack-plugin
每次打包清空打包目錄
NOTE: Node v10+ and webpack v4+ are supported and tested.
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
module.exports = {
plugins: [
new CleanWebpackPlugin()
],
};
html-webpack-plugin
Plugin that simplifies creation of HTML files to serve your bundles 自動為我們打包后目錄生成index.html并引起js入口文件
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
plugins: [
new HtmlWebpackPlugin({
template: './public/index.html' // 自定義模板進行覆蓋(webpack會對比兩個index.html模板文件,保留更改的部分)
}),
new webpack.DefinePlugin({ // webpack內置插件,可以定義常量
BASEURL: '"./"'
})
]
/ public/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vue</title>
<link rel="icon" href="<%= BASEURL =>favicon.ico">
</head>
<body>
<div id="app"></div>
</body>
</html>
原文鏈接:https://blog.csdn.net/qq_36413371/article/details/121307042
相關推薦
- 2022-09-20 基于C語言實現隨機點名器(附源碼)_C 語言
- 2022-06-16 golang配置管理神器Viper使用教程_Golang
- 2023-03-25 Excel?VBA指定條件刪除整行整列的實現_vbs
- 2023-04-07 React?Fiber構建completeWork源碼解析_React
- 2022-09-22 判斷數據類型的五種方法
- 2022-04-08 從頭學習C語言之for語句和循環嵌套_C 語言
- 2022-07-23 Python代碼實現雙鏈表_python
- 2022-10-04 Go語言底層原理互斥鎖的實現原理_Golang
- 最近更新
-
- 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同步修改后的遠程分支