Skip to content

[VueLoaderPlugin Error] No matching rule for .vue files found - when files have different extension than .vue #1238

Closed
@roysanchez

Description

@roysanchez

Version

15.0.0-rc.1

Reproduction link

N/A

Steps to reproduce

const path = require('path');
const webpack = require('webpack');
const { VueLoaderPlugin } = require('vue-loader')


module.exports = (env) => {
   const isDevBuild = !(env && env.prod);

   return [{
       stats: { modules: false },
       context: __dirname,
       resolve: { extensions: [ '.js', '.ts' ] },
       entry: { 'main': './ClientApp/boot.ts' },
       module: {
            rules: [
                { test: /\.vue\.html$/, loader: 'vue-loader' },  //Change this line to { test: /\.vue/, loader: 'vue-loader' } to make it work
                { test: /\.ts$/, use: 'ts-loader?silent=true' }
            ]
        },
       output: {
           path: path.join(__dirname,  './wwwroot/dist'),
           filename: '[name].js',
           publicPath: 'dist/'
       },
       plugins: [
           new VueLoaderPlugin()
       ]
   }];

};

What is expected?

The bundle is successful

What is actually happening?

Webpack throws the following error:
[VueLoaderPlugin Error] No matching rule for .vue files found.
Make sure there is at least one root-level rule that matches .vue files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions