這是我的目錄webpack.config.js-----》var?htmlWebpackPlugin?=?require('html-webpack-plugin');
module.exports?=?{
entry:'./src/js/main.js',
output:{
path:__dirname+'/dist/js/',
filename:'[name].js'//__dirname
},
plugins:[
new?htmlWebpackPlugin()
]
}package.json -----》{
??"name":?"project",
??"version":?"1.0.0",
??"description":?"",
??"main":?"index.js",
??"scripts":?{
????"test":?"echo?\"Error:?no?test?specified\"?&&?exit?1"
??},
??"author":?"",
??"license":?"ISC",
??"devDependencies":?{
????"html-webpack-plugin":?"^2.30.1"
??}
}html.html------------><!DOCTYPE?html>
<html>
<head>
<title></title>
</head>
<body>
</body>
</html>
使用html-webpack-plugin,運行webpack,老是報錯?
俞什么
2018-01-12 11:28:47