[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 : {
}
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章