javascript - 冲突:多个资产发射到相同的文件名 index.html
问题描述
我已经创建了多个 javascript 和 html 页面,用于使用 webpack 进行导航。我正在使用 HtmlWebpackPlugin 实现 webpack 的多个页面。请原谅我的简洁,因为我是 webpack 开发的新手。
这是我的 webpack 配置:
module.exports = {
entry: {
index: './app/src/producer/index.js',
process: './app/src/process/process.js',
results: './app/src/results/results.js'
},
mode: 'production',
output: {
path: buildPath,
filename: '[name].[hash:20].js'
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin({
filename: 'index.html',
template: 'app/src/producer/index.html',
inject: 'body',
chunks: ['index']
}
),
new HtmlWebpackPlugin({
filename: 'process.html',
template: 'app/src/process/index.html',
inject: 'body',
chunks: ['process']
}
),
new HtmlWebpackPlugin({
filename: 'results.html',
template: 'app/src/results/index.html',
inject: 'body',
chunks: ['results']
}
),
这是我的分页项目结构:
解决方案
推荐阅读
- python-3.6 - uWSGI 上自定义类的内存损坏
- select - FITS_rec 和数据选择:屏蔽而不是“真实”过滤?
- c# - 读取文本文件的第一行 c#
- android - 如何在没有多个背景 xml 的情况下更改自定义 toasts 消息的背景?
- javascript - 在 React 中渲染之前检查宽度
- java - LocalDate 获取上周星期六的日期
- python - 为什么 Python 在连接 ElasticSearch Server 后不返回 True
- sql - 如何优化 SQL 查询(Oracle 数据库)
- php - 文件.htacces AddType 无法正常工作
- javascript - 在画布上围绕圆周旋转矩形