Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 4 months 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 (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-08-01T04:23:21.000Z (over 1 year ago)
- Last Synced: 2024-10-05T16:01:23.976Z (4 months 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 `[email protected]` and up.
> Install `[email protected]` 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)