Rspack Bundler
Rspack-specific configuration for ESBoot.
Rspack is a high-performance Rust-based bundler with strong compatibility with Webpack-style configuration.
Base Config Support
Rspack mode supports the same major ESBoot options as Webpack mode, including:
server.proxyserver.httpsserver.http2server.openserver.portoutputPathpublicPathuseLangJsonPickerminimizejsMinifierjsMinifierOptionscssMinifiercssMinifierOptionsanalyzealiasdefinesourceMapexternalscopysvgrsvgrOptionsassetsInlineLimitpx2remuseTailwindcss
Note
Rspack mode currently uses swc_core and browserslist for target configuration.
Base Feature Support
- Compatibility (ES2020+)
- Code splitting
CSS Modules and styleName Support
esboot-bundler-rspack includes a custom WASM plugin, rspack-plugin-stylename, to support styleName in JSX and TSX.
Highlights
- Written in Rust and compiled to WASM
- Converts
styleName="foo"into runtimestyles[...]lookups - Includes camelCase fallback for kebab-case CSS class names
- Preserves existing
classNameexpressions and combines them correctly
The plugin is enabled automatically when using bundler-rspack.
customConfig
- Type:
(config: RspackConfig) => RspackConfig
Use this when ESBoot's higher-level config is not enough and you need direct Rspack control.
export default defineConfig((compileConfig) => {
return {
customConfig: (cfg) => {
return cfg;
},
};
});