在webpack中使用vue运行webpack时报错:
解决方案:
第一步:在webpack.config.js配置文件中导入插件VueLoaderPlugin插件:
const VueLoaderPlugin = require('vue-loader/lib/plugin');
第二步:在导出模块(module.exports)中的plugins属性中new一个实例:
module.exports={
entry:'./src/main.js',
output:{
path:path.join(__dirname,'dist'),
filename:'bundle.js'
},
plugins:[
new htmlWebpackPlugin({
template:'./src/index.html',
filename:'index.html'
}),
new VueLoaderPlugin()
]
}