webpack-08-多页面应用打包 发表于 2019-11-17 | 分类于 webpack | 本文总阅读量 次 对多页面应用的打包 多页应用打包12345678910111213141516171819202122232425const path = require('path');const HtmlWebpackPlugin = require('html-webpack-plugin');module.exports = { mode: 'development', entry: { home: './src/index.js', other: './src/other.js' }, output: { filename: '[name].js', path: path.resolve(__dirname, 'dist'), }, plugins: [ new HtmlWebpackPlugin({ filename: 'home.html', src: path.resolve(__dirname, 'index.html'), chunks: ['home'] }), new HtmlWebpackPlugin({ filename: 'other.html', src: path.resolve(__dirname, 'index.html'), chunks: ['other'] }) ]}