Configurator
Tick what your app needs, and copy the two blocks into your project: one for build.gradle.kts, one for install(Svelte).
- Only settings that differ from the defaults appear, so the result stays short.
- The panel on the right recommends what most apps should turn on. Click Apply to take a recommendation.
Recommended
- OperationsPin Bun so CI and new laptops build without installing anything.
- OperationsAdd a health endpoint for Docker, Kubernetes or a load balancer.
- OperationsSet your public address so sitemap.xml and robots.txt never depend on the Host header.
- SecurityRefuse JSON bodies with huge strings.
- SecurityAdd a strict rate limit for your login route.
- PerformanceResize images and serve AVIF and WebP automatically.
build.gradle.kts
import io.github.nijasc.ktor.svelte.gradle.DaisyTheme
svelte {
libraries {
daisyUi {
themes(DaisyTheme.ShadcnLight, DaisyTheme.ShadcnDark)
defaultTheme(DaisyTheme.ShadcnLight)
prefersDark(DaisyTheme.ShadcnDark)
}
lucide()
toasts()
routes()
}
}Application.kt
import io.github.nijasc.ktor.svelte.Svelte
install(Svelte) {
generateTs = true
apiDocs = true
}Only settings that differ from the defaults are shown. Run ./gradlew svelteSync after changing libraries, and ./gradlew svelteConfig to review the result.
Where to go from here
- Every option is explained in Gradle settings and tasks and Ktor settings.
- For an existing project,
./gradlew svelteConfigshows what is set now and scores it the same way. See Review your configuration. - Starting from scratch? The setup script writes a whole project for you.