# babel-plugin-import-load

> jlb-tools对应按需加载插件

Latest version **1.0.0-Alpha** (published 2018-11-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-import-load
pnpm add babel-plugin-import-load
yarn add babel-plugin-import-load
bun add babel-plugin-import-load
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-Alpha |
| Published | 2018-11-13 |
| First published | 2018-11-12 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 13.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | py419569317 |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-import-load
- Repository: https://github.com/Pasoul/babel-plugin-import-load
- Homepage: https://github.com/Pasoul/babel-plugin-import-load#readme
- Issues: https://github.com/Pasoul/babel-plugin-import-load/issues
- npm.io page: https://npm.io/package/babel-plugin-import-load

## Dependencies (2)

- [babel-core](https://npm.io/package/babel-core.md) ^6.26.3
- [babel-types](https://npm.io/package/babel-types.md) ^6.26.0

## Recent versions

- 1.0.0-Alpha (latest) — 2018-11-13
- 1.0.0 — 2018-11-12

## README

# Descrip

[jtools](https://github.com/Pasoul/jtools)按需加载插件

# Usage

## 安装

`yarn add babel-plugin-import-load --dev`
or
`npm install babel-plugin-import-load --save-dev`

## 在webpack中配置

```js
// .babelrc
{
	// ...
	"plugins": [
	     ["import-load", {"library": "jlb-tools"}]
	]
}
// webpack.config.js
module: {
	rules: [
		{
		  	test: /\.js$/,
			loader: 'babel-loader'
		}
	]
}
```

or

```diff
module: {
    rules: [
      {
        test: /\.js$/,
        loader: "babel-loader",
 +       options: {
 +         plugins: [["import-load", { library: "jlb-tools" }]]
 +       }
      }
    ]
 }
```

# tip

通过 `import {handleEmoji} from 'jlb-tools'` 查找依赖时，babel会自动解析成 `import handleEmoji from 'jlb-tools/lib/handleEmoji'`,从而实现按需加载

---
_Source: https://npm.io/package/babel-plugin-import-load · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
