Modularly import rsuite components for babel.
dependencies:
$ npm i --save rsuite@next
$ npm i --save-dev babel-preset-rsuite@next
.babelrc
{
"presets": ["rsuite"]
}
Transforms
import { Button } from 'rsuite';
roughly to
var _Button = require('rsuite/lib/Button');
.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');
.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');