# babel-plugin-optimization-import

> This plugin is used to import on demand.

Latest version **0.1.1** (published 2019-02-09) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2019-02-09 |
| First published | 2018-12-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 23.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Stephen Liu |
| Maintainers | beancommons |
| Keywords | import, babel-plugin |

## Links

- npm: https://www.npmjs.com/package/babel-plugin-optimization-import
- Homepage: https://github.com/stephenliu1944/babel-plugin-optimization-import
- Issues: https://github.com/stephenliu1944/babel-plugin-optimization-import/issues
- npm.io page: https://npm.io/package/babel-plugin-optimization-import

## Dependencies (2)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.0.0
- [@babel/helper-module-imports](https://npm.io/package/@babel/helper-module-imports.md) ^7.0.0

## 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

- 0.1.1 (latest) — 2019-02-09
- 0.1.0 — 2019-02-09
- 0.1.0-alpha.1 — 2018-12-16

## README

# babel-plugin-optimization-import
This plugin is used to import on demand.

## Install
```
npm install -D babel-plugin-optimization-import
```

## Usage
```js
{
    presets: []
    plugins: [
        ['babel-plugin-optimization-import', {
            library: 'antd',
            directory: 'lib',           // default to 'lib'
            namingRule: 'dash',         // 'little-camel', 'big-camel', 'dash', 'underline', function, default to 'big-camel'.
            importDefault: false,       // default to true.
            style: {                    // true or object, default to null.
                directory: 'style',     // 'style' or '/less/component', default to upper directory.
                namingRule: 'index',    // 'little-camel', 'big-camel', 'dash', 'underline', string, function, default to null.
                ext: 'css'              // js, css, less, sass, default to null.
            }
        }]
    ]
}
```

###
Use for antd.

###
Use for material-ui.

###
Use for elementalui

## Options
```js
{
    library,
    directory,
    namingRule,
    style: {     
        directory,
        namingRule,
        extension
    }
}
```
### library
string, default to null.  
Set library name.
### directory
string, default to 'lib'.  
Set component directory. 
### namingRule
'little-camel', 'big-camel', 'dash', 'underline' or function, default to 'big-camel'.
### importDefault
boolean, default to true.
Transform import type to default.
### style
boolean or object, default to false.
import related style file and set import mode with style.
#### directory
string, default to component directory.
Set style directory. 
#### namingRule
'little-camel', 'big-camel', 'dash', 'underline', custom string or function, default to null.
#### extension
string, default to null.
style file extension, example 'css', 'less', 'sass' or 'js'.

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