[当我运行命令npm run build
时,我希望应该像本教程中10:00那样将index.html
复制到dist
中:https://www.youtube.com/watch?v=TzdEpgONurw&t=602s
但是什么也没有发生,没有警告,也没有错误。这是配置:
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.export ={
mode: 'development',
module: {
rules: [
{
test: /.html$/,
use: [
{
loader: 'html-loader',
options: {minimize: true}
}
]
}
]
},
plugins: [
new HtmlWebpackPlugin({
template: './src/index.html',
filename:'./index.html'
}),
],
}
如Grzegorz T的建议,这是一个错字。已将module.export
纠正为module.exports
以解决此问题。