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

refactor!: avoid import.meta polyfill #3213

Merged
merged 2 commits into from
Mar 11, 2025
Merged

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Mar 11, 2025

We have introduced a polyfill for import.meta in nitro v2 for platform compatibility however with advancements of runtimes, there will be more leverages of platform native import.meta.

Downside of depending on platform import.meta is that the value differs between source and bundle.

For internal use of serveStatic (to resolve public dir relative to server entry) a lightweight globalThis.__nitro_meta__ injection is used instead. (hopefully one day we can use import.meta.main instead: nodejs/node#49440)

@pi0 pi0 changed the title refactor!: avoid import.meta polyfill refactor!: avoid import.meta polyfill Mar 11, 2025
@pi0 pi0 merged commit 3cb7dc8 into v3 Mar 11, 2025
5 checks passed
@pi0 pi0 deleted the refactor/import-meta-transform branch March 11, 2025 14:30
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.

1 participant