unjs / unenv

๐Ÿ•Š๏ธ Convert javaScript code to be runtime agnostic
MIT License
342 stars 18 forks source link

fix(nodelss): inject and polyfill node `global` #193

Closed IgorMinar closed 1 month ago

IgorMinar commented 1 month ago

Since global comes mainly from Node.js, we should by default provide it's polyfill in the nodeless preset so that other presets don't need to define it.

For example Deno preset shouldn't need to define that it needs the global polyfill, as we expect the target environment to compose env(nodeless, deno) together.

๐Ÿ”— Linked issue

n/a

โ“ Type of change

๐Ÿ“š Description

๐Ÿ“ Checklist