Babel plugin that rewrites Promise references to the es6-promise polyfill only when necessary (i.e., when the native Promise is not available). Version 1.1.1 is the latest stable release. Key differentiator: it conditionally loads the polyfill based on environment, reducing bundle size for modern platforms. Requires es6-promise as a separate dependency (peer dependency). Tested with Node 0.10+, but primarily useful for legacy browser support and older Node versions.
npm install babel-plugin-es6-promiseVerified import paths — ran on the pinned version, not inferred.
Setup and usage of babel-plugin-es6-promise: install, configure Babel, and see the transformation with conditional polyfill loading.
Run `npm install --save es6-promise` in addition to the plugin.
Avoid combining with other Babel plugins that rely on ES module syntax transformations.
Use unique variable names in your code; the plugin renames all Promise references globally.
Consider modern alternatives like @babel/plugin-transform-runtime with core-js or polyfill-service.
Run `npm install --save es6-promise`.
Ensure plugin is installed: `npm install --save-dev babel-plugin-es6-promise`. Use short name 'es6-promise' in config, not the full 'babel-plugin-es6-promise'.
Check Babel config includes "plugins": ["es6-promise"] and run Babel on files that use Promise.