0.0.1-beta.0 • Published 4 years ago

babel-plugin-import-demo v0.0.1-beta.0

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

babel-plugin-import-demo

Example

{ "libraryName": "antd", style: true }

import { Button } from 'antd';
ReactDOM.render(<Button>xxxx</Button>);

      ↓ ↓ ↓ ↓ ↓ ↓

var _button = require('antd/lib/button');
require('antd/lib/button/style');
ReactDOM.render(<_button>xxxx</_button>);

options

options can be object.

{
  "libraryName": "antd",
  "libraryDirectory": "lib",
  "style": true,
}

style

["import", { "libraryName": "antd", "style": true }]

import js and css modularly (LESS/Sass source files)