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

Nuxt usage of scanDirExports is extremly slow if Nuxt is used with layers #401

Open
fabianwohlfart opened this issue Dec 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@fabianwohlfart
Copy link

Environment

Operating System: Darwin
Node Version: v22.11.0
Nuxt Version: 3.14.1592
CLI Version: 3.16.0
Nitro Version: 2.10.4
Package Manager: [email protected]
Builder: -
User Config: default
Runtime Modules: -
Build Modules: -

Reproduction

https://github.com/fabianwohlfart/test__nuxt-layers-slowdown

Describe the bug

I basically want to raise awareness in this repo.

Nuxt uses scanDirExports from unimport here: https://github.com/nuxt/nuxt/blob/main/packages/nuxt/src/imports/module.ts
It seems like that more folders than expected are scanned, if Nuxt layers are used.

I raised an issue in Nuxt with details here:
nuxt/nuxt#30137

The reproduction is a Nuxt app with layers.
If a layer is a sibling of a folder with a lot of files, these slow down the bundling.

Going back to Unimport 3.13.4 solves the issue (tinyglobby??!)

  "devDependencies": {
    "unimport": "3.13.4"
  },
  "overrides": {
    "unimport": "3.13.4"
  }

Additional context

No response

Logs

No response

@fabianwohlfart
Copy link
Author

tinyglobby got back to me, it's already fixed in their upcoming release.

"overrides": {
  "tinyglobby": "https://pkg.pr.new/tinyglobby@d51e2b9"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant