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

node:process free solution #27

Open
jimmywarting opened this issue Sep 26, 2023 · 1 comment
Open

node:process free solution #27

jimmywarting opened this issue Sep 26, 2023 · 1 comment

Comments

@jimmywarting
Copy link

Some bundlers automatically polyfills global Buffer and process if they can detect it being used.
it really bugs me soooo much.

trying to import this via a cdn like: https://esm.sh/browser-or-node
is going to import both node:process and node:events. just for using process in the code.

i think if you use isNode = globalThis.process?.versions?.node then, you will be fine.

@jimmywarting
Copy link
Author

jimmywarting commented Sep 26, 2023

also, was wondering if you could include BunJS detection into this as well...

this would then really have to change name from something like runtime-environment instead of browser-or-node
guess it's too late for that now...

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

No branches or pull requests

1 participant