Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chenjiahan/babel-plugin-dynamic-import-polyfill
Add `array.iterator` polyfill for webpack dynamic import
https://github.com/chenjiahan/babel-plugin-dynamic-import-polyfill
Last synced: 3 months ago
JSON representation
Add `array.iterator` polyfill for webpack dynamic import
- Host: GitHub
- URL: https://github.com/chenjiahan/babel-plugin-dynamic-import-polyfill
- Owner: chenjiahan
- Created: 2020-01-08T10:35:05.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-11T01:30:58.000Z (over 3 years ago)
- Last Synced: 2024-10-03T09:25:31.057Z (3 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 11
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# babel-plugin-dynamic-import-polyfill
Add `array.iterator` polyfill for webpack dynamic import
Fix the following issue:
> Dynamic imports are not working in IE10. The following error is shown in the console: "Unhandled promise rejectionTypeError: Target is not iterable". @babel/preset-env is used with core-js@3.
## Example
#### In
```js
import('./foo');
```#### Out
```js
import "core-js/modules/es.object.to-string";
import "core-js/modules/es.promise";
import "core-js/modules/es.array.iterator"; // <- Added by pluginimport('./foo');
```## Installation
```bash
npm install --save-dev babel-plugin-dynamic-import-polyfill
```## Usage
.babelrc
```json
{
"plugins": ["babel-plugin-dynamic-import-polyfill"]
}
```## References
- https://github.com/babel/babel/issues/9872
- https://github.com/babel/babel/issues/9873
- https://github.com/babel/babel/issues/10140