Skip to content

Commit

Permalink
Update SvelteKit Documentation to support dev mode (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
treo authored Nov 24, 2023
1 parent 1b32dd7 commit 4ac11eb
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions docs/modules/ROOT/pages/web-frameworks.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ a|
a|
[source,bash]
----
npm create svelte@latest myapp
npm create svelte@latest webui
----
a|
- https://kit.svelte.dev/[Svelte Kit]
Expand Down Expand Up @@ -208,8 +208,15 @@ This will configure the build to export the static files:

[#svelte-kit-config]
=== Svelte Kit Configuration
SvelteKit needs to be configured to create a single page application.
You will not be able to use any of its server-side only functionality.
See also https://kit.svelte.dev/docs/single-page-apps[SvelteKit documentation on Single-page apps].

It will work in production mode though with the following changes:
Disable server side rendering at the root layout (`src/routes/+layout.js`):
[source,javascript]
----
export const ssr = false;
----

Install Svelte Static adapter:

Expand All @@ -218,9 +225,9 @@ Install Svelte Static adapter:
npm i -D @sveltejs/adapter-static
----

Configure `svelte.config` file with the following changes:
Configure `svelte.config.js` file with the following changes:

[source,json]
[source,javascript]
----
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/kit/vite';
Expand All @@ -241,6 +248,9 @@ export default config;
In `application.properties` add:
[source,properties]
----
quarkus.quinoa.dev-server=false
quarkus.quinoa.build-dir=build
quarkus.quinoa.enable-spa-routing=true
%dev.quarkus.quinoa.dev-server.index-page=/
----

WARNING: Currently, for technical reasons, the Quinoa SPA routing configuration won't work with RESTEasy Classic. See xref:advanced-guides.adoc#spa-routing[SPA routing] for a workaround.

0 comments on commit 4ac11eb

Please sign in to comment.