Provides the regenerator runtime as a self-contained module for bundling with Rollup. Version 6.23.1 is the latest stable release. It replaces the default babel-runtime regenerator import with a local copy, avoiding external dependencies when using async/await and generators in libraries compiled with Rollup. Key differentiator: allows bundling regenerator runtime without requiring the full babel-runtime package, reducing bundle size and avoiding issues with Rollup's module resolution.
npm install rollup-regenerator-runtimeVerified import paths — ran on the pinned version, not inferred.
Shows Babel configuration to replace babel-runtime regenerator with rollup-regenerator-runtime, and the import needed in the entry file.
Use `import 'rollup-regenerator-runtime';` or `require('rollup-regenerator-runtime');` without assigning to a variable.Ensure Babel configuration includes the plugins as shown in quickstart.
Set `moduleName` to 'rollup-regenerator-runtime' in transform-runtime options and import 'rollup-regenerator-runtime' in your entry file.
Ensure `import 'rollup-regenerator-runtime';` is placed at the top of your entry file, before any async functions.