Skip to content

refactor!: avoid import.meta polyfill - #3213

Merged
pi0 merged 2 commits into
v3from
refactor/import-meta-transform
Mar 11, 2025
Merged

pi0 merged 2 commits into
v3from
refactor/import-meta-transform

Conversation

@pi0

@pi0 pi0 commented Mar 11, 2025 •

Copy link
Copy Markdown
Member

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
@pi0
pi0 deleted the refactor/import-meta-transform branch March 11, 2025 14:30
@TheAlexLichter

Copy link
Copy Markdown
Member

nodejs/node#57804 is supported in LTS now (since Node 22.18.0) 👏🏻

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.

2 participants