HtmlWebpackPlugin | webpack 中文文档 | webpack中文文档 | webpack中文网
安装
npm install --save-dev html-webpack-plugin
- 下载html-webpack-plugin本地软件包
npm i html-webpack-plugin --save-dev
- 配置webpack.config.js让webpack拥有插件功能
javascript
const HtmlWebpackPlugin = require('html-webpack-plugin');
javascript
plugins: [new HtmlWebpackPlugin()],
plugins 配置插件选项
配置项
GitHub - jantimon/html-webpack-plugin:简化 HTML 文件的创建,以便为您的 webpack 捆绑包提供服务
- 重新打包 npm run build