html引用webpack插件,使用html-webpack-plugin,运行webpack,老是报错?
生活随笔
收集整理的這篇文章主要介紹了
html引用webpack插件,使用html-webpack-plugin,运行webpack,老是报错?
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
這是我的目錄
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------------>html>
總結
以上是生活随笔為你收集整理的html引用webpack插件,使用html-webpack-plugin,运行webpack,老是报错?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 计算机中的数据是指什么(什么是计算机图形
- 下一篇: 《英雄联盟》13.7 版本更新:国服延长