fix(nuxt): exclude non-cwd auto-imports and don't process _all_ files#5421
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.
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.
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.
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.
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.
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