-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
fix(nuxt): re-initialise nuxt._ignore
after all modules run
#26680
Conversation
|
338328d
to
7376a17
Compare
7376a17
to
414a76f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The more I think about this, the more I think we should initiate nuxt ignorer after modules have finished running (maybe directly before build?) - and we should no longer check the contents of nuxt.options.ignore
.
@danielroe you mean for nuxt 4? |
I think we can do it in a non breaking way for Nuxt 3. |
nuxt.options.ignore
nuxt._ignore
after modules:done hook
nuxt._ignore
after modules:done hooknuxt._ignore
after modules:done
hook
nuxt._ignore
after modules:done
hooknuxt._ignore
after all modules run
🔗 Linked issue
📚 Description
(I raised this in Discord just about an hour ago, thought I'd make a PR anyway)
The
nuxt.options.ignore
is not modifiable by Nuxt modules as it is resolved and populated before the modules are installed andmodules:done
is called. This is because we are resolving layer modules usingresolveFiles
which callsisIgnored
that populatesnuxt._ignore
if already not populated. So, when the modules are installed and any of them modifynuxt.options.ignore
, the!nuxt._ignore
condition is never true and options are not updated. This fix will check ifnuxt._ignorePattern
(asnuxt._ignore
is of different type) is outdated fromnuxt.options.ignore
and re-populate accordingly. Added tests as well.