-
-
Couldn't load subscription status.
- Fork 1k
fix(nuxt): exclude non-cwd auto-imports and don't process _all_ files #5421
Conversation
β Deploy Preview for nuxt3-docs canceled.
|
| const include = options.transform?.include || [] | ||
|
|
||
| // Custom includes | ||
| if (include.some(pattern => id.match(pattern))) { |
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.
Shouldn't we keep this check after exclude? (ie: explicit include without explicit exclude). It is current behavior before (https://github.com/nuxt/framework/pull/5042/files#diff-1edf1ef633d6d36d0410fe36249ca18b1f5fd1a58b658296696698c2fc542ee9L18)
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.
No, because we exclude node_modules, and therefore we would never be able to override to include layers within node_modules.
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.
Then maybe reverse?
- Include checks:
- include
node_modules/<layer>/<!node_modules>
- include
- Exclude checks: (if not an include pattern match)
- exclude
node_modules
- exclude
Combined method with && in this PR works but makes it unable to explicitly include a pattern.
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 point is that we still need to perform checks on the file extension.
I don't know what you mean by:
Combined method with && in this PR works but makes it unable to explicitly include a pattern.
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.
Previously we had two checks for exlude list and include list option. We are now checking for all excludes only if they are not included.... Anyway let's merge and see any upcoming limitations with this. Options are mostly internal now.
π Linked issue
resolves nuxt/nuxt#14136
β Type of change
π Description
This fixes a regression introduced by #5042, by:
node_modulesto autoImports include.includebut only the ones that match the test for file timeπ Checklist