1
Help us understand the problem. What are the problem?

More than 3 years have passed since last update.

posted at

updated at

Organization

【webpack】vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.

vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.

Error | エラー

webpack で vue-loader を使用する際に以下のエラーが出ることがある。

vue-loader was used without the corresponding plugin. Make sure to include VueLoaderPlugin in your webpack config.

Solution | 解決方法

webpack.config.js の plugins に VueLoaderPlugin の記述を追加する必要がる。

const { VueLoaderPlugin } = require("vue-loader");

module.exports = {
  plugins: [new VueLoaderPlugin()]
};

Supplement | 補足

vue-loader の使用方法

  1. インストール

    # using npm
    npm install vue-loader --save-dev
    
    # using yarn
    yarn add vue-loader --dev
    
  2. webpack.config.js への記述

    ※ entry, outputなどは適宜記述ください。 

    const { VueLoaderPlugin } = require("vue-loader");
    
    module.exports = {
      module: {
        rules: [
          {
            test: /\.vue$/,
            loader: "vue-loader"
          }
        ]
      },
      plugins: [new VueLoaderPlugin()]
    }
    
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
1
Help us understand the problem. What are the problem?