[email protected]的坑

在这里插入图片描述

  • 首先将报错的依赖uninstall,然后下载最新版。
  • 然后会遇到上图的错误,原因是:[email protected]中Vue-loader必须是15以上的版本,而Vue-loader在15.*之后的版本都是 vue-loader的使用都是需要伴生 VueLoaderPlugin的,所以解决方案是
  • 在webpack.config.js中加入
const VueLoaderPlugin = require('vue-loader/lib/plugin');
  • 在webpack.config.js中的module.exports中添加new VueLoaderPlugin()
const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
    devtool: "sourcemap",
    entry: './js/entry.js', // 入口文件
    output: {
        filename: 'bundle.js' // 打包出来的wenjian
    },
    plugins: [
        // make sure to include the plugin for the magic
        new VueLoaderPlugin()
    ],
    module : {
}
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章