From 1d8b828d1bbe0e0daa64f6fc2689799c7169afa0 Mon Sep 17 00:00:00 2001 From: Kit La Touche Date: Thu, 19 Sep 2024 23:26:39 -0400 Subject: Add basic browser client Using Svelte. No tests, no linting, yet. This is just starting to get familiar with things. You'll still have to run the dev server and the dev client builder each in their own terminals. Enjoy! --- hi-ui/svelte.config.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 hi-ui/svelte.config.js (limited to 'hi-ui/svelte.config.js') diff --git a/hi-ui/svelte.config.js b/hi-ui/svelte.config.js new file mode 100644 index 0000000..7f55c59 --- /dev/null +++ b/hi-ui/svelte.config.js @@ -0,0 +1,15 @@ +import adapter from '@sveltejs/adapter-auto'; +import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; + +/** @type {import('@sveltejs/kit').Config} */ +const config = { + kit: { + // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. + // If your environment is not supported, or you settled on a specific environment, switch out the adapter. + // See https://kit.svelte.dev/docs/adapters for more information about adapters. + adapter: adapter() + }, + preprocess: vitePreprocess() +}; + +export default config; -- cgit v1.2.3 From 671b36c2c8d4026eb7a34f0ac7bd5720b34f1a0d Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Sat, 28 Sep 2024 00:43:43 -0400 Subject: Configure the SvelteKit build process to build a static site. This is the [recommended] adapter for a single-page app. That's approximately how I expect to deploy the UI. [recommended]: https://kit.svelte.dev/docs/single-page-apps --- hi-ui/package-lock.json | 11 +++++++++++ hi-ui/package.json | 1 + hi-ui/src/routes/+layout.svelte | 2 ++ hi-ui/svelte.config.js | 6 ++++-- 4 files changed, 18 insertions(+), 2 deletions(-) (limited to 'hi-ui/svelte.config.js') diff --git a/hi-ui/package-lock.json b/hi-ui/package-lock.json index 14e0c8a..65bf5af 100644 --- a/hi-ui/package-lock.json +++ b/hi-ui/package-lock.json @@ -12,6 +12,7 @@ }, "devDependencies": { "@sveltejs/adapter-auto": "^3.0.0", + "@sveltejs/adapter-static": "^3.0.5", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", "@types/eslint": "^9.6.0", @@ -1088,6 +1089,16 @@ "@sveltejs/kit": "^2.0.0" } }, + "node_modules/@sveltejs/adapter-static": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@sveltejs/adapter-static/-/adapter-static-3.0.5.tgz", + "integrity": "sha512-kFJR7RxeB6FBvrKZWAEzIALatgy11ISaaZbcPup8JdWUdrmmfUHHTJ738YHJTEfnCiiXi6aX8Q6ePY7tnSMD6Q==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@sveltejs/kit": "^2.0.0" + } + }, "node_modules/@sveltejs/kit": { "version": "2.5.28", "resolved": "https://registry.npmjs.org/@sveltejs/kit/-/kit-2.5.28.tgz", diff --git a/hi-ui/package.json b/hi-ui/package.json index 663cf81..de72564 100644 --- a/hi-ui/package.json +++ b/hi-ui/package.json @@ -11,6 +11,7 @@ }, "devDependencies": { "@sveltejs/adapter-auto": "^3.0.0", + "@sveltejs/adapter-static": "^3.0.5", "@sveltejs/kit": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", "@types/eslint": "^9.6.0", diff --git a/hi-ui/src/routes/+layout.svelte b/hi-ui/src/routes/+layout.svelte index f54f3bf..67a5fa5 100644 --- a/hi-ui/src/routes/+layout.svelte +++ b/hi-ui/src/routes/+layout.svelte @@ -1,5 +1,7 @@
diff --git a/hi-ui/svelte.config.js b/hi-ui/svelte.config.js index 7f55c59..07e332f 100644 --- a/hi-ui/svelte.config.js +++ b/hi-ui/svelte.config.js @@ -1,4 +1,4 @@ -import adapter from '@sveltejs/adapter-auto'; +import adapter from '@sveltejs/adapter-static'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; /** @type {import('@sveltejs/kit').Config} */ @@ -7,7 +7,9 @@ const config = { // adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list. // If your environment is not supported, or you settled on a specific environment, switch out the adapter. // See https://kit.svelte.dev/docs/adapters for more information about adapters. - adapter: adapter() + adapter: adapter({ + fallback: 'index.html', + }), }, preprocess: vitePreprocess() }; -- cgit v1.2.3