const path = require('path'); const HtmlWebpackPlugin = require('html-webpack-plugin'); module.exports = { entry: { main:'./src/script/main.js', a:'./src/script/a.js' }, output: { path:path.join(__dirname,'./dist'), filename: 'js/[name].js' }, plugins: [ new HtmlWebpackPlugin({ filename: 'index.html', template:'index.html', inject:"head", title:"webpack is good", data:"1" }) ], }
template 那裡開頭"h"要小寫:
使用 webpack 4.25.1
安装
html-webpack-plugin
插件了吗
我也一样,请问楼主找到什么原因了吗?
我猜想是不是插件没安装好