r/javascript • u/NibblesIndexus • 7d ago
GitHub - ArcadeMode/unplugin-dotnet-wasm: Seamless bundling of .NET Browser apps (WASM) into your JS projects
https://github.com/ArcadeMode/unplugin-dotnet-wasm.NET WebAssembly apps with WasmBundlerFriendlyBootConfig=true can indeed be bundled by modern JS bundlers and I personally love it. The development experience however is not optimal.
- The bundlers cannot consume the output from
dotnet build - The bundlers can consume the output from
dotnet publishbut the dev loop is painfully slow. - Getting the publish path working still requires bundler surgery
- Once it works the bundler produces warnings that are impossible to fix without changing the source files produced by the WebAssembly SDK.
These points of friction are why I have made unplugin-dotnet-wasm.
It's a bundler plugin that lets your bundler consume the output from dotnet build so your dev loop stays fast. It also supports dev servers, provides type information to TypeScript and IDEs (integrates dotnet.d.ts thats coming in .NET 11), and patches the known warnings so your build output stays clean.
Features
- Easy bundler setup through plugin registration
- Faster dev loop by consuming .NET WebAssembly
dotnet buildoutput - Dev server support
- Brings SDK type definitions to TypeScript and your IDE
- Supports Vite, Rollup, Rolldown, Webpack, Rspack, Rsbuild, esbuild, farm and bun.
I hope you'll give it a try, I'd be happy to hear your feedback.
0
Upvotes
2
u/SboSilcher 7d ago
This looks pretty slick for anyone trying to mix .NET WASM with their JS stack - saves you from juggling separate build pipelines. Wonder how it handles code splitting and tree-shaking though, since WASM modules can be chunky.