ERROR in ./src/vue/App.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 11:0-32 16:9-12
ERROR in ./src/vue/App.vue?vue&type=style&index=0&id=5e019a2f&scoped=true&lang=css&
20:0
Module parse failed: Unexpected token (20:0)
File was processed with these loaders:
* ./node_modules/vue-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|
|
> .title{
| color:green;
| }
@ ./src/vue/App.vue 4:0-87
@ ./src/main.js
ERROR in ./src/vue/App.vue?vue&type=template&id=5e019a2f&scoped=true& 2:0
Module parse failed: Unexpected token (2:0)
File was processed with these loaders:
* ./node_modules/vue-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|
> <div id="app">
| <h2>{{message}}</h2>
| </div>
@ ./src/vue/App.vue 1:0-94 11:2-8 12:2-17
@ ./src/main.js
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mettingwebpack@1.0.0 build: `webpack --mode development`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mettingwebpack@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\software\node\node_cache\_logs\2020-02-05T15_27_05_431Z-debug.log
解决方法
. 在webpack.config.js中加入
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
plugins: [
// make sure to include the plugin for the magic
new VueLoaderPlugin()
],
module : {
...
}
}