html-webpack-plugin
con npm
npm install html-webpack-plugin -D
con Yarn
yarn add html-webpack-plugin -D
...
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
...
plugins: [
new HtmlWebpackPlugin({
// Inserta los assets en el documento HTML
inject: true,
// Ubicación de tu HTML en el proyecto
template: "./public/index.html",
// Nombre y dirección del HTML que se creara al momento de ejecutar webpack
filename: "./index.html"
})
]
}