Skip to content

Nitro scanModules returns every files #2680

Description

@Barbapapazes

Environment

nitropack-nightly@3.0.0-beta-28665895.e727afda-nitro-nightly-mirror

Reproduction

  1. Create the dir modules
  2. Add the file log/index.ts and log/runtime/routes/log.ts
  3. Inspect the return of https://github.com/unjs/nitro/blob/d20ffcbd16fc4003b774445e1a01e698c2bb078a/src/core/scan.ts#L44

Describe the bug

You'll see that the return will have both the index.ts file which define the module and the log.ts file which define an event handler. This makes the local modules system unusable.

Like Nuxt, this could be nice to only scan two patters (https://nuxt.com/docs/guide/directory-structure/modules#:~:text=The%20auto%2Dregistered,modules/*.ts)

The auto-registered files patterns are:

  • modules/*/index.ts
  • modules/*.ts

Additional context

No response

Logs

No response

Activity

  1. added
    pending triage
    on Aug 22, 2024
  2. added
    bug
    and removed
    pending triage
    on Sep 2, 2026
  3. added theissue type on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions