錯誤提示
ERROR in ./src/login.vue
Module Error (from ./node_modules/vue-loader/lib/index.js):
vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.
@ ./src/main.js 7:13-35
@ multi (webpack)-dev-server/client?http://localhost:3000 (webpack)/hot/dev-server.js ./src/main.js
ERROR in ./src/login.vue?vue&type=template&id=19e76240& 2:0
Module parse failed: Unexpected token (2:0)
You may need an appropriate loader to handle this file type.
|
> <div>
| <h1>這是使用 .vue 文件創建的登陸模板</h1>
| </div>
@ ./src/login.vue 1:0-84 10:2-8 11:2-17 30:4-35:6 30:68-35:5 32:16-22 33:25-40
@ ./src/main.js
@ multi (webpack)-dev-server/client?http://localhost:3000 (webpack)/hot/dev-server.js ./src/main.js
原因
[參考官方文檔](https://vue-loader.vuejs.org/migrating.html#a-plugin-is-now-required)
解決辦法
// webpack.config.js
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = {
// ...
plugins: [
new VueLoaderPlugin()
]
}
作者:izwell
來源:CSDN
原文:https://blog.csdn.net/MessageBox_/article/details/81434193
版權聲明:本文爲博主原創文章,轉載請附上博文鏈接!