# babel-plugin-cc-import-lib

> a babel plugin to import lib --cc

Latest version **1.1.1** (published 2018-06-29) · ISC license · 0 weekly downloads

## Install

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

## 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.1.1 |
| Published | 2018-06-29 |
| First published | 2018-06-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | jsupot |
| Maintainers | jsupot |
| Keywords | babel, plugin, import |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-cc-import-lib
- npm.io page: https://npm.io/package/babel-plugin-cc-import-lib

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2018-06-29
- 1.1.0 — 2018-06-29
- 1.0.0 — 2018-06-29

## README

## 简单实现对象的结构

- 在.babelrc或者package.json中进行配置，libraryName为需要按需加载的库
- 如果需要引入样式，则增加style字段

## 通过 `.babelrc` or babel-loader 增加配置

```js
{
  "plugins": [["cc-import-lib", options]]
}
```

### options

`options` 是一个对象.

```javascript
{
  "libraryName": "lodash",
  "style": true, 
}
```

##For Example: 

```javascript

{
  ...

  "plugins": [
    ...
    
    ["cc-import-lib", {
      "libraryName": "lodash",
      "style": true
    }]
  ]
}

```

##转换

```javascript
import { clone, copy } from 'lodash';

      ↓ ↓ ↓ ↓ ↓ ↓

import clone from 'lodash/clone';
import 'lodash/clone/style';
import copy from 'lodash/copy';
import 'lodash/copy/style';
```

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