Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/wotermelon/babel-plugin-syntax-dynamic-lazy-import

Modules is loaded as needed.
https://github.com/wotermelon/babel-plugin-syntax-dynamic-lazy-import

Last synced: about 1 month ago
JSON representation

Modules is loaded as needed.

Awesome Lists containing this project

README

        

# babel-plugin-syntax-dynamic-lazy-import

> Allow parsing of `lazyImport()`

Modules only on demand.

## Installation

```bash
npm install babel-plugin-syntax-dynamic-lazy-import --save-dev
```

## Usage

Via `.babelrc` or babel-loader.

```json
{
"plugins": ["syntax-dynamic-lazy-import"]
}
```

## Example

```js
const component = lazyImport('./xx.js', 'xxChunkFileName')
```