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

fix(nuxt): re-initialise nuxt._ignore after all modules run #26680

Merged
merged 12 commits into from
Apr 19, 2024

Conversation

ineshbose
Copy link
Member

🔗 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 and modules:done is called. This is because we are resolving layer modules using resolveFiles which calls isIgnored that populates nuxt._ignore if already not populated. So, when the modules are installed and any of them modify nuxt.options.ignore, the !nuxt._ignore condition is never true and options are not updated. This fix will check if nuxt._ignorePattern (as nuxt._ignore is of different type) is outdated from nuxt.options.ignore and re-populate accordingly. Added tests as well.

Copy link

stackblitz bot commented Apr 6, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Member

@danielroe danielroe left a 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.

@manniL
Copy link
Member

manniL commented Apr 18, 2024

@danielroe you mean for nuxt 4?

@danielroe
Copy link
Member

I think we can do it in a non breaking way for Nuxt 3.

@danielroe danielroe changed the title fix(kit): allow updating of nuxt.options.ignore fix(nuxt): re-initialise nuxt._ignore after modules:done hook Apr 18, 2024
@danielroe danielroe changed the title fix(nuxt): re-initialise nuxt._ignore after modules:done hook fix(nuxt): re-initialise nuxt._ignore after modules:done hook Apr 18, 2024
@danielroe danielroe changed the title fix(nuxt): re-initialise nuxt._ignore after modules:done hook fix(nuxt): re-initialise nuxt._ignore after all modules run Apr 19, 2024
@danielroe danielroe merged commit 00a47be into nuxt:main Apr 19, 2024
37 checks passed
@github-actions github-actions bot mentioned this pull request Apr 19, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants