https://github.com/goto-bus-stop/babel-plugin-dynamic-import-split-require
babel plugin to compile `import()` syntax to `split-require`, the commonjs bundle splitting library
https://github.com/goto-bus-stop/babel-plugin-dynamic-import-split-require
babel babel-plugin bundle-splitting dynamic-import
Last synced: about 1 year ago
JSON representation
babel plugin to compile `import()` syntax to `split-require`, the commonjs bundle splitting library
- Host: GitHub
- URL: https://github.com/goto-bus-stop/babel-plugin-dynamic-import-split-require
- Owner: goto-bus-stop
- License: other
- Created: 2017-11-14T15:41:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-08-01T04:23:21.000Z (almost 3 years ago)
- Last Synced: 2025-03-24T10:17:16.858Z (about 1 year ago)
- Topics: babel, babel-plugin, bundle-splitting, dynamic-import
- Language: JavaScript
- Homepage: https://npmjs.com/package/babel-plugin-dynamic-import-split-require
- Size: 15.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
# babel-plugin-dynamic-import-split-require
babel plugin to compile `import()` syntax to `split-require`, the commonjs bundle splitting library
> v2+ of this plugin works with `split-require@3.1.0` and up.
> Install `babel-plugin-dynamic-import-split-require@1.x` if you are using an older version.
[![npm][npm-image]][npm-url]
[![travis][travis-image]][travis-url]
[![standard][standard-image]][standard-url]
[npm-image]: https://img.shields.io/npm/v/babel-plugin-dynamic-import-split-require.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/babel-plugin-dynamic-import-split-require
[travis-image]: https://img.shields.io/travis/goto-bus-stop/babel-plugin-dynamic-import-split-require.svg?style=flat-square
[travis-url]: https://travis-ci.org/goto-bus-stop/babel-plugin-dynamic-import-split-require
[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square
[standard-url]: http://npm.im/standard
## Install
```
npm install babel-plugin-dynamic-import-split-require
```
## Usage
In .babelrc:
```json
{
"plugins": [
"dynamic-import-split-require"
]
}
```
### Input
```js
import('whatever').then(onwhatever)
```
### Output
```js
var _import = require('split-require');
_import("whatever").then(onwhatever);
```
This code can be bundled by browserify using the [`split-require`](https://github.com/goto-bus-stop/split-require#readme) plugin.
## License
[Apache-2.0](LICENSE.md)