Examples overview
Each example here is a complete project: the setup steps, the config files, and working Rust and JavaScript you can run. Pick the one that matches your build tool.
Web applicationsβ
- Web Webpack - browser applications using Webpack.
Backend and CLI applicationsβ
- Node.js Webpack - server-side applications using Webpack.
- Bun - the Bun runtime, wired through a preload plugin.
- esbuild - fast bundling for Node.js or the browser using the esbuild plugin.
- Rspack - Rust-based bundling with the Webpack-compatible loader, unchanged.
- Rollup - bundling for Node.js or the browser using the Rollup plugin.
- Vite - SSR and client builds using the Vite plugin (the
nodestrategy for the server,webfor the client).
Full-stack frameworksβ
- Next.js - App Router with the
withRustWasmhelper. The same.rsworks from Server Components, Client Components, and Edge routes (thenodestrategy for the server,webfor the client, and a pre-compiled module on Edge), under both Turbopack and webpack.
Desktop applicationsβ
- Electron - main and renderer processes with Webpack (
electron-mainuses thenodestrategy,electron-rendererusesweb), with the wasm bytes inlined into both.
TypeScriptβ
- TypeScript types - type
.rsimports with the ambient floor, thegen-typesCLI, the build-timetypesoption, and the editor Language Service plugin.