nitrojs / nitrojs/nitro

Support import.meta.glob

Open
#1,671 12 comments 12 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
11.2k
Forks
899
Avg merge
2d 24m
Merged PRs (30d)
40

Description

Describe the feature

Following https://github.com/nuxt/nuxt/issues/22106, I would like to have import.meta.glob("./migrations/*.ts") available in Nitro apps, in particular in Nuxt server handlers.

As I elaborated in #1670, this should be lazy by default, repeating how Vite works. An option to pass { eager: true }(same as in Vite) would be nice but not critical, as this could be achieved in user-land.

Additional information
  • Would you be willing to help implement this feature?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked Nuxt issue #22106 and issue #1670, then compare Vite's import.meta.glob behavior and lazy default with Nitro's handling of server handlers. The work is done when Nitro apps can use the requested migration glob and the eager option is either supported or explicitly scoped out.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript, vite
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.