默认webpack无法打包 .vue文件,需要安装相关的loader
cnpm i vue-loader vue-template-compiler -D
在webpack.config.js中配置路径:
{test:/\.vue$/,use:'vue-loader'}
ERROR in ./src/login.vue
Module Error (from ./node_modules/_vue-loader@15.9.3@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 47:0-32 54:26-31
直接这样子会出现上面的错误,貌似新版的要再下载:
cnpm i vue-loader-plugin -S
且在webpack.config.js文件中添加:
const VueLoaderPlugin =require('vue-loader/lib/plugin')
plugins:[
new VueLoaderPlugin()
],