A Babel preset for modularly importing rsuite components, transforming named imports from 'rsuite' to individual require() calls (e.g., 'rsuite/lib/Button'). Integrates with babel-plugin-import to enable tree-shaking and optional automatic CSS/less imports, including theme support (default, dark). Version 4.0.1 targets rsuite@next and is maintained by the rsuite team. Unlike manual import optimization, this preset automates code splitting and reduces bundle size for rsuite applications.
npm install babel-preset-rsuiteVerified import paths — ran on the pinned version, not inferred.
Installs and configures the preset with style and dark theme, showing import transformation output.
Consider configuring babel-plugin-import directly: { libraryName: 'rsuite', libraryDirectory: 'lib', style: true }.Ensure 'babel-plugin-import' is installed: npm install --save-dev babel-plugin-import.
Use the array syntax when customizing options.
Update rsuite to the 'next' tag: npm install rsuite@next.
Add less-loader to your webpack config: { test: /\.less$/, use: ['style-loader', 'css-loader', 'less-loader'] }.Remove customComponentName from options; use babel-plugin-import directly if needed.
npm install --save-dev babel-plugin-import
Use module.exports = { presets: ['rsuite'] }; instead of default export.Install less-loader and configure webpack: { test: /\.less$/, use: ['style-loader', 'css-loader', 'less-loader'] }.Use array syntax: presets: [['rsuite', { style: true }]]