vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.




不知道怎么解决了,请大家帮帮忙,老师在么?
const path = require('path')
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports={
entry:path.join(__dirname,'src/index.js'),
output: {
filename: "bundle.js",
path: path.join(__dirname,'dist')
},
module: {
rules: [
{
test:/.vue$/,
loader: "vue-loader"
},
{
test:/.css$/,
use:[
'style-loader',
'css-loader'
]
}
]
},
plugins: [
// make sure to include the plugin for the magic
new VueLoaderPlugin()
]
}webpack.config.js 如以上写法,记得下载style-loader、css-loader
由于webpack4版本问题需要修改webpack.config.js配置
emmm 虽然我没遇到这错 但是看了一下你的代码 vueloader的版本忒新了 搜了一下你的错误 这个链接里有一个解决办法 你可以试一下 :https://www.imooc.com/article/details/id/29655
说是最新的vueloader需要在config.js里去设置一下它
另附一下我的package.json里的dependencies:
"dependencies": {
"cross-env": "^5.1.3",
"css-loader": "^0.28.7",
"file-loader": "^1.1.6",
"html-webpack-plugin": "^2.30.1",
"style-loader": "^0.19.1",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1",
"url-loader": "^0.6.2",
"vue": "^2.5.13",
"vue-loader": "^13.6.0",
"vue-template-compiler": "^2.5.13",
"webpack-dev-server": "^2.11.2"
},
"devDependencies": {
"webpack": "^3.10.0"
}
希望能帮到你·········