Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continue looking for vue rule if not the first rule encountered #1896

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rfox12
Copy link

@rfox12 rfox12 commented Nov 3, 2021

I believe "continue" was intended here instead of "break". Unless there is a good reason the vue rule should be the first non-enforce rule.

#1826
#1625
#1574

I believe "continue" was intended here instead of "break".  Unless there is a good reason the vue rule should be the first non-enforce rule.

https://githubmemory.com/repo/vuejs/vue-loader/issues/1826
james-ingold added a commit to james-ingold/vue-loader that referenced this pull request Nov 8, 2021
@jherdman
Copy link

I don't believe this is correct either. I'm working on a project that has some Vue code, and some plain JS. If I implement your change I see this despite having some Vue files in play:

[webpack-cli] Error: [VueLoaderPlugin Error] No matching rule for .vue files found.
Make sure there is at least one root-level rule that matches .vue or .vue.html files

Your change, however, does get me further down the road in solving the error in the noted lined tickets.

@jherdman
Copy link

I've tracked this down to a problem in my own configuration. I have a rule supplied by Shakapacker that looks like this:

  test: /\.html$/,
  exclude: /\.(js|mjs|jsx|ts|tsx)$/,
  type: 'asset/source'
}

This rule trips the foo.vue.html test, which, in turn, confuses vue-loader.

I'm not a Vue expert by any stretch of the imagination, so I'm unclear if the foo.vue.html test is valid or not, but it seems like I need to intercept the rule above and improve the exclude regex.

Good luck on your own journey!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants