Closed curran closed 3 years ago
Unfortunately that package is no longer maintained and the maintainers are next to impossible to work with. The rollup project no longer recommends it.
Oh I see. Thanks for the tip!
Out of curiosity, what is the recommended way to get Node polyfills in a Rollup context? Browserify plugin?
The Rollup source still recommends it: https://github.com/rollup/rollup/blob/ce2592df6b369b68d61f58c2ef8bf4695421146a/src/finalisers/shared/warnOnBuiltins.ts#L39
yeah there have been some open issues about that line of code. while that legacy bit of code stays, we can't in good conscience add that to the list here for the reasons stated. there have been some other projects attempting to fill the void, but everything ends up incomplete and it's a bit overwhelming for maintainers to tackle
Understood. Thanks!
I think I'll give the Browserify Rollup plugin a spin and see if that does the job. I recall from years ago that Browserify did polyfill Node builtins, but haven't touched it in years.
Oh wow, that https://www.npmjs.com/package/rollup-plugin-browserify-transform module hasn't been published in 4 years.
Found that other issue: Stop recommending node-globals/node-builtins plugin #2881.
Submitted a patch upstream https://github.com/rollup/rollup/pull/4190
Looks like https://github.com/snowpackjs/rollup-plugin-polyfill-node is the clear winner.
Awesome Contribution Checklist:
Please Provide a Link A Repository for Your Addition
https://github.com/ionic-team/rollup-plugin-node-polyfills
Please Describe Your Addition
This is a mature package that polyfills Node builtins (such as EventEmitter). It is actually recommended by a Rollup warning that reads as follows:
So, I was surpised that it's not on this list! As I've been using this list as a reference so frequently, I figured I'd open this PR to add this entry.
Thanks for maintaining!