A Rollup plugin that provides browser polyfills for Node.js built-in modules (e.g., 'buffer', 'process', 'events', 'stream', 'util', 'path', 'crypto', 'fs') in bundles. Current stable version is 0.13.4. Community-maintained fork of ionic-team/rollup-plugin-node-polyfills with updated support for Rollup v1–v4 and TypeScript types. Key differentiator: it leverages ES6 named imports for tree-shakable polyfills, targeting node_modules by default. Not all modules are fully shimmed—some are empty or partial (e.g., http, https, crypto, fs). Active development.
npm install rollup-packages-polyfill-coreNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic setup: import the plugin, configure options (include all files, enable source maps), and use Buffer and process polyfills.
Avoid relying on these polyfills for critical logic; test thoroughly.
Use a modern URL parser instead of punycode.
If only small parts are needed, consider manual polyfills or tree-shaking with named imports.
Explicitly set include: null to cover all files.
Continue using include/exclude as documented.
Install rollup-plugin-polyfill-node and add it to your rollup.config.js plugins list.
Import explicitly: import { Buffer } from 'buffer';Use import statement: import nodePolyfills from 'rollup-plugin-polyfill-node';
Check the support table; if polyfill is partial, consider using a different approach or avoid importing that module.