babel-preset-rsuite
v4.0.1
Published
Modularly import rsuite components for babel.
Downloads
1,148
Readme
babel-preset-rsuite
Modularly import rsuite components for babel.
dependencies:
Install
$ npm i --save rsuite@next
$ npm i --save-dev babel-preset-rsuite@next
Usage
.babelrc
{
"presets": ["rsuite"]
}
Transforms
import { Button } from 'rsuite';
roughly to
var _Button = require('rsuite/lib/Button');
With styles
.babelrc
{
"presets": [["rsuite", { style: true }]]
}
Transforms
import { Button } from 'rsuite';
roughly to
require('rsuite/lib/Button/styles/index.less');
var _Button = require('rsuite/lib/Button');
Use theme styles
.babelrc
{
"presets": [["rsuite", { style: true, theme: 'dark' }]]
}
Transforms
import { Button } from 'rsuite';
roughly to
require('rsuite/lib/Button/styles/themes/dark.less');
var _Button = require('rsuite/lib/Button');