fix(nuxt): re-initialise nuxt._ignore after all modules run#26680
Merged
fix(nuxt): re-initialise nuxt._ignore after all modules run#26680
nuxt._ignore after all modules run#26680Conversation
|
|
danielroe
reviewed
Apr 7, 2024
338328d to
7376a17
Compare
7376a17 to
414a76f
Compare
danielroe
reviewed
Apr 8, 2024
danielroe
reviewed
Apr 18, 2024
Member
danielroe
left a comment
There was a problem hiding this comment.
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.
Member
|
@danielroe you mean for nuxt 4? |
Member
|
I think we can do it in a non breaking way for Nuxt 3. |
nuxt.options.ignorenuxt._ignore after modules:done hook
nuxt._ignore after modules:done hooknuxt._ignore after modules:done hook
danielroe
approved these changes
Apr 19, 2024
nuxt._ignore after modules:done hooknuxt._ignore after all modules run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
📚 Description
(I raised this in Discord just about an hour ago, thought I'd make a PR anyway)
The
nuxt.options.ignoreis not modifiable by Nuxt modules as it is resolved and populated before the modules are installed andmodules:doneis called. This is because we are resolving layer modules usingresolveFileswhich callsisIgnoredthat populatesnuxt._ignoreif already not populated. So, when the modules are installed and any of them modifynuxt.options.ignore, the!nuxt._ignorecondition is never true and options are not updated. This fix will check ifnuxt._ignorePattern(asnuxt._ignoreis of different type) is outdated fromnuxt.options.ignoreand re-populate accordingly. Added tests as well.