Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/iakoug/babel-plugin-authkit

A plugin that make import on demand.
https://github.com/iakoug/babel-plugin-authkit

Last synced: 1 day ago
JSON representation

A plugin that make import on demand.

Awesome Lists containing this project

README

        

# babel-plugin-authkit
A plugin that make `import` on demand.

See also [`babel-plugin-lodash`](https://github.com/megawac/babel-plugin-lodash).

#### Example

Converts

```js
import { a, b } from 'authkit';

a(b);
```

Converts above to:

```js
import _a from 'authkit/src/a';
import _b from 'authkit/src/b';

_a(_b);
```

#### Usage

###### Via `.babelrc`

```json
{
"plugins": ["authkit", {
// Package name loaded on demand
"lib": 'packageName',
// Single file directory to load on demand
// The default is `node_modules/packageName/es/src/*`
"esDirectory": "es/src",
}]
}
```