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

feat(glob-import): support { import: '*' } #8071

Merged
merged 1 commit into from May 9, 2022

Conversation

antfu
Copy link
Member

@antfu antfu commented May 9, 2022

Description

By default, when as: 'raw' is specified, the glob will interpret to import the default entry for convenience.

import.meta.glob('pattern', { as: 'raw' }) // Record<string, () => Promise<string>>

With this PR, it will allow to specify { import: '*' } to force import as the whole module

import.meta.glob('pattern', { as: 'raw', import: '*' }) // Record<string, () => Promise<Module>>

Additional context

Unblock #7756 (comment)


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@antfu antfu mentioned this pull request May 9, 2022
9 tasks
@patak-dev patak-dev merged commit 0b78b2a into main May 9, 2022
@patak-dev patak-dev deleted the feat/glob-import-asterisk branch May 9, 2022 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants