Back to articles
Rspack Has a Free API — Webpack-Compatible Bundler Written in Rust

Rspack Has a Free API — Webpack-Compatible Bundler Written in Rust

via Dev.to WebdevAlex Spinov

Rspack is a drop-in webpack replacement written in Rust. It's 5-10x faster than webpack while keeping full compatibility with webpack plugins and loaders. Why Rspack? 5-10x faster than webpack Webpack-compatible — use existing webpack.config.js, plugins, loaders Built-in — CSS, TypeScript, JSX, asset processing — no extra loaders needed HMR — instant hot module replacement Quick Start npm create rspack@latest myapp cd myapp npm install npm run dev Configuration (webpack-compatible) // rspack.config.js module . exports = { entry : ' ./src/index.tsx ' , output : { filename : ' [name].[contenthash].js ' , path : ' ./dist ' , }, module : { rules : [ { test : / \. tsx ? $/ , use : ' builtin:swc-loader ' , options : { jsc : { parser : { syntax : ' typescript ' , tsx : true }, transform : { react : { runtime : ' automatic ' } }, }, }, }, { test : / \. css$/ , type : ' css ' , // Built-in CSS support! }, { test : / \.( png|jpg|gif|svg ) $/ , type : ' asset ' , }, ], }, plugins : [ new rspack .

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
3 views

Related Articles