Skip to content

rsuite/babel-preset-rsuite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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');

About

Modularly import rsuite components for babel.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published