cyco130 / esbuild-plugin-polyfill-node

ESBuild plugin to polyfill Node.js built-ins geared towards edge environments.
MIT License
55 stars 8 forks source link

Import for "os" is broken in browser #3

Closed patdx closed 1 year ago

patdx commented 1 year ago

The "os" polyfill loads this file: https://unpkg.com/browse/os@0.1.2/index.js

Which, in browser environment, just creates an infinite loop.

I think something like os-browserify/browser.js would be more useful:

https://unpkg.com/browse/os-browserify@0.3.0/browser.js

cyco130 commented 1 year ago

You're absolutely right. Fixed in 0.1.3, thanks for reporting.

I'll add tests and an option to use the more modern jspm polyfills before 1.0.