const path = require('path') const HtmlWebpackPlugin = require('html-webpack-plugin') const { CleanWebpackPlugin } = require("clean-webpack-plugin") module.exports = { entry: { index: './src/index.js', other: './src/other.js' }, output: { path: path.resolve(__dirname, 'dist'), filename: "[name].js" }, plugins: [ new CleanWebpackPlugin({ paths: path.resolve(__dirname, 'dist'), }), new HtmlWebpackPlugin({ template: Path.resolve (__dirname, 'SRC /index.html'),// template address filename: 'index.html',// generated filename hash: SRC ="other.js? Bbe98d06b18a1dc381fd "title: 'the index page, / / to generate the index file title note: template page title < title > < % = htmlWebpackPlugin. Options. The title % > < / title > chunks: Resolve (__dirname, 'SRC /other.html'), new HtmlWebpackPlugin({template: path.resolve(__dirname,' SRC /other.html'), filename: 'other.html', hash: true, title: 'other page ', chunks: ['other']})]}Copy the code