error:
ERROR in ./src/login.vue?vue&type=template&id=19e76240& 2:0
Module parse failed: Unexpected token (2:0)
File was processed with these loaders:
* ./node_modules/_vue-loader@15.7.1@vue-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|
> <div>
| </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
在webpack搭建的環(huán)境當(dāng)中運(yùn)行vue組件的時(shí)候報(bào)錯(cuò)旺嬉,我已經(jīng)下載了vue-template-compiler
和vue-loader
,在render中還是無法正常顯示組件內(nèi)容导而,查了下資料發(fā)現(xiàn)是
Vue-loader在15.*之后的版本都是 vue-loader的使用都是需要伴生 VueLoaderPlugin的
所以我們要在這兩個(gè)的基礎(chǔ)上再去下載這個(gè)插件
npm i vue-loader-plugin -S
然后在配置文件(webpack.config.js)那邊要加上
// webpack.config.js
const VueLoaderPlugin = require('vue-loader/lib/plugin')
module.exports = {
// ...
plugins: [
new VueLoaderPlugin()
]
}
資料來源:https://vue-loader.vuejs.org/migrating.html#a-plugin-is-now-required