In this document, you will learn how to build a Svelte 5 or Svelte 4 application using Rsbuild.
You can use create-rsbuild
to create a project with Rsbuild + Svelte. Just execute the following command:
Then select Svelte 5
or Svelte 4
when prompted to "Select framework".
To compile Svelte components (.svelte
files), you need to register the Rsbuild Svelte plugin. The plugin will automatically add the necessary configuration for Svelte builds.
For example, register in rsbuild.config.ts
: