插件(plugins)
https://www.webpackjs.com/plugins/
html-webpack-plugin
https://www.webpackjs.com/plugins/html-webpack-plugin/
html-webpack-plugin
会在打包结束后,自动生成一个html文件,并把打包生成的 js 自动引入到这个 html 文件中
src/index.html
1 2 3 4 5 6 7 8 9 10 |
|
1 2 3 |
|
plugin 可以在 webpack 运行到某个时刻的时候,帮你做一些事情
clean-webpack-plugin
https://github.com/johnagan/clean-webpack-plugin
npm install clean-webpack-plugin -D
1 2 3 4 5 6 7 8 |
|