@shiye515 用过这个,如果是传统页面,不是要写 N 个配置? Generating Multiple HTML Files To generate more than one HTML file, declare the plugin more than once in your plugins array:
{ entry: 'index.js', output: { path: 'dist', filename: 'index_bundle.js' }, plugins: [ new HtmlWebpackPlugin(), // Generates default index.html new HtmlWebpackPlugin({ // Also generate a test.html filename: 'test.html', template: 'src/assets/test.html' }) ] }