All the main features that Rsbuild supports.
| Features | Description | Links |
|---|---|---|
| Rspack | Use Rspack as the bundler by default | |
| SWC compilation | Transform and minify JavaScript and TypeScript code using SWC by default | |
| TS compilation | TypeScript files are compiled using SWC by default | |
| Code minification | Code minification is enabled by default in production mode | |
| Polyfill injection | Optional feature, inject core-js and other polyfills | |
| SourceMap generation | Source maps are generated in development mode by default | |
| Alias | Optional feature, set import alias | |
| Babel compilation | Optional feature, use Babel to transform JavaScript and TypeScript code | |
| Node outputs | Optional feature, build bundles that run in Node.js environment | |
| Web Workers | Optional feature, use Web Workers | |
| Browserslist | Optional feature, use browserslist to specify which browsers should be supported in your web application. | |
| Compatibility check | Optional feature, analyze if there are incompatible advanced syntax in the outputs within the current browser scope | |
| Environment variable | Optional feature, inject environment variables or expressions into the code | |
| Node polyfill | Optional feature, inject polyfills for Node core modules on the browser side | |
| Type check | Optional feature, run type checker to check for type issues in code | |
| Module Federation | Optional feature, dynamically load modules and share dependencies |
| Features | Description | Links |
|---|---|---|
| Lightning CSS | Use Lightning CSS to downgrade CSS syntax by default | |
| PostCSS transformation | Optional feature, use PostCSS to transform CSS files | |
| Tailwind CSS | Optional feature, use Tailwind CSS | |
| UnoCSS | Optional feature, use UnoCSS | |
| Sass preprocessing | Optional feature, compile Sass/Scss files | |
| Less preprocessing | Optional feature, compile Less files | |
| Stylus preprocessing | Optional feature, compile Stylus files | |
| CSS Modules compilation | Support compiling *.module.* files by default | |
| CSS Modules type | Optional feature, generate type definition for CSS Modules | |
| CSS minification | CSS minification is enabled by default in production build | |
| Inline CSS into JS | Optional feature, inline CSS files to JavaScript files |
| Features | Description | Links |
|---|---|---|
| Set title | Set HTML <title> tag | |
| Set meta | Set HTML <meta> tag | |
| Set favicon | Set favicon | |
| Set app icon | Set web application icons | |
| EJS template engine | Optional feature, use EJS template engine | |
| Pug template engine | Optional feature, use pug template engine | |
| Inline JS files | Optional feature, inline JS files into HTML | |
| Inline CSS files | Optional feature, inline CSS files into HTML |
| Features | Description | Links |
|---|---|---|
| Public dir | Use the public directory as the directory for serving public assets by default | |
| SSR | Optional feature, implement server-side rendering | |
| Proxy | Optional feature, proxy requests to the specified service | |
| Open page | Optional feature, automatically open page in browser when starting server | |
| HTTPS | Optional feature, enable HTTPS server | |
| Custom middleware | Optional feature, use custom middleware |
| Features | Description | Links |
|---|---|---|
| React | Optional feature, enable compilation of React JSX | |
| React Refresh | Optional feature, enable React Refresh | |
| SVGR | Optional feature, transform SVG to React component | |
| Vue 3 SFC | Optional feature, enable compilation of Vue 3 SFC (Single File Components) | |
| Vue 3 JSX | Optional feature, enable compilation of Vue 3 JSX syntax | |
| Vue 2 SFC | Optional feature, enable compilation of Vue 2 SFC (Single File Components) | |
| Vue 2 JSX | Optional feature, enable compilation of Vue 2 JSX syntax | |
| Svelte | Optional feature, enable compilation of Svelte component | |
| Solid | Optional feature, enable compilation of Solid JSX |
| Features | Description | Links |
|---|---|---|
| Image assets | Support for import image assets in code | |
| Font assets | Support for import font assets in code | |
| Video assets | Support for import video assets in code | |
| Wasm assets | Support for import WebAssembly assets in code | |
| Node addons | Support for import Node.js addons in code | |
| Inline static assets | Small assets are inlined into JS by default | |
| Clean up static assets | Automatically clean up static assets in the dist directory before each build | |
| Copy static assets | Optional feature, copy static assets to the dist directory | |
| Generate manifest file | Optional feature, generate manifest.json file |
| Features | Description | Links |
|---|---|---|
| Chunk splitting | A variety of chunk splitting strategies are built into Rsbuild to automatically split the bundle into files of moderate size | |
| Print file size | After the production build, all bundle sizes are displayed by default | |
| Analyze build process | Optional feature, use Rsdoctor to analyze build process | |
| Analyze bundle size | Optional feature, analyze bundle size through Bundle Analyzer | |
| Remove console | Optional feature, remove console.[methodName] in code | |
| Optimize moment.js size | Optional feature, remove the redundant locale files of moment.js | |
| Dedupe packages | Optional feature, remove duplicate npm packages | |
| Component on-demand import | Optional feature, selectively import code and styles from component libraries | |
| Image compression | Optional feature, compress used image resources | |
| Preload | Optional feature, preemptively fetch and cache the target resource for current navigation | |
| Prefetch | Optional feature, preemptively fetch and cache the target resource for a followup navigation | |
| Preconnect | Optional feature, preemptively connect to the target resource's origin | |
| DNS prefetch | Optional feature, preemptively perform DNS resolution for the target resource's origin |