Back to articles
Rspack Has a Free Webpack-Compatible Bundler — 10x Faster Builds Without Changing Your Config

Rspack Has a Free Webpack-Compatible Bundler — 10x Faster Builds Without Changing Your Config

via Dev.to JavaScriptAlex Spinov

Why Rspack? Rspack is a Webpack-compatible bundler written in Rust. Drop it into existing Webpack projects for 5-10x faster builds — same config, same plugins, same loaders. npm install @rspack/cli @rspack/core rspack.config.js (Webpack-Compatible) module . exports = { entry : ' ./src/index.js ' , output : { filename : ' bundle.js ' , path : __dirname + ' /dist ' }, module : { rules : [ { test : / \. tsx ? $/ , use : ' builtin:swc-loader ' , options : { jsc : { parser : { syntax : ' typescript ' , tsx : true } } } }, { test : / \. css$/ , type : ' css ' }, ], }, plugins : [ new ( require ( ' @rspack/core ' ). HtmlRspackPlugin )()], } Migration from Webpack Replace webpack with @rspack/core in imports Replace webpack-cli with @rspack/cli Rename webpack.config.js to rspack.config.js Most loaders/plugins work unchanged Speed Comparison Project Webpack Rspack Dev start 12s 1.2s HMR 500ms 50ms Production 45s 5s Rspack vs Vite vs Webpack Feature Rspack Vite Webpack Speed 10x Webpack Very fas

Continue reading on Dev.to JavaScript

Opens in a new tab

Read Full Article
5 views

Related Articles