13
Wed Oct 19 2022 03:22:02 GMT+0000 (Coordinated Universal Time)
Saved by
@Vrushabh_123
// 1. import
const HtmlWebpackPlugin = require("html-webpack-plugin");
// 2. add the plugin in config
{
//....
plugins: [
new HtmlWebpackPlugin({
title: "vanillaJS app",
template: path.resolve(__dirname, "src", "index.html")
})
],
// 3. add clean:true to output to keep the dist folder clean
output: {
filename: "main.js",
path: path.resolve(__dirname, "dist"),
clean: true // <---- one more addition
},
}
content_copyCOPY
Comments