# babel-plugin-library

> tool-libraries and tool-libraries-daling Load plugins on demand

Latest version **1.0.1** (published 2019-05-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install babel-plugin-library
pnpm add babel-plugin-library
yarn add babel-plugin-library
bun add babel-plugin-library
```

## 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.1 |
| Published | 2019-05-17 |
| First published | 2019-05-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Maintainers | aaronshen |

## Links

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

## Recent versions

- 1.0.1 (latest) — 2019-05-17
- 1.0.0 — 2019-05-16

## README

<h1 align="center">babel-plugin-library</h1>
<div align="center">
  <img width="300" src="https://raw.githubusercontent.com/AaronBank/static-files/master/images/tool-babel.jpg" alt="babel-plugin-library">
</div>

<div align="center">
  <br />
  <a href="https://github.com/AaronBank/babel-plugin-library/blob/master/README.ZH.md">Chinese</a> | 
  <a href="https://github.com/AaronBank/babel-plugin-library">English</a>
  <br /><br />
  <img src="https://img.shields.io/badge/license-MIT-green.svg"/> 
  <img src="https://img.shields.io/badge/npm-v6.5.0-blue.svg"/> 
  <img src="https://img.shields.io/badge/Version-1.0.0-brightgreen.svg"/>
</div>
<br/>

<div align="center">
  <a href="https://github.com/AaronBank/tool-libraries">tool-libraries</a>
  load <b>babel</b> plugin on demand
</div>

### Installation

```javascript
npm install babel-plugin-library --save-dev
```

### Use

**Method 1：Configure in `.babelrc`**

- `.babelrc`

```javascript
{
  "plugins": [
    [
      "babel-plugin-library",
      {"libraryName": "tool-libraries"}
    ]
  ]
}
```

> `webpack`

```javascript
module: {
  rules: [{
    test: /\.js$/,
    loader: "babel-loader",
  }]
}
```

---

**Method 2：Configure directly in `webpack`**

```javascript
module.exports = {
  ...
  module: {
    rules: [{
      test: /\.js$/,
      loader: "babel-loader",
      options: {
        plugins: [
          [
            "babel-plugin-library",
            {"libraryName": "tool-libraries"}
          ]
        ]
      }
    }]
  }
  ...
}
```

### Conversion

```javascript
// Before conversion =>
import { types } from 'tool-libraries'

// After conversion =>
import equal from 'tool-libraries/lib/types'
```

## Licence ##
**[MIT](https://github.com/AaronBank/babel-plugin-library/blob/master/LICENSE)**

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