From 8bf2958e1dd47384834c981300d8d80909d9e894 Mon Sep 17 00:00:00 2001 From: Max Richter Date: Tue, 30 Apr 2024 14:25:26 +0200 Subject: [PATCH] fix: build erorr --- package.json | 5 ++--- packages/ui/package.json | 1 + packages/ui/svelte.config.js | 25 +++++++++++++++---------- pnpm-lock.yaml | 7 +++++++ 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index c39ff8f..1f50fb4 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,10 @@ { "scripts": { "build": "pnpm build:nodes && pnpm build:app", - "build:app": "pnpm -r --filter 'ui' build && pnpm -r --filter 'app' build", + "build:app": "BASE_PATH=/ui pnpm -r --filter 'ui' build && pnpm -r --filter 'app' build", "build:nodes": "pnpm -r --filter './nodes/**' build", - "build:stories": "pnpm -r --filter 'ui' story:build", "dev:nodes": "pnpm -r --parallel --filter './nodes/**' dev", - "build:deploy": "pnpm build && pnpm build:stories && cp -r ./packages/ui/.histoire/dist ./app/build/ui", + "build:deploy": "pnpm build && cp -r ./packages/ui/build ./app/build/ui", "dev": "pnpm -r --filter 'app' --filter './packages/node-registry' dev" } } diff --git a/packages/ui/package.json b/packages/ui/package.json index b87ee25..c94f613 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -32,6 +32,7 @@ }, "devDependencies": { "@sveltejs/adapter-auto": "^3.0.0", + "@sveltejs/adapter-static": "^3.0.1", "@sveltejs/kit": "^2.0.0", "@sveltejs/package": "^2.0.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", diff --git a/packages/ui/svelte.config.js b/packages/ui/svelte.config.js index 4a82086..31623fc 100644 --- a/packages/ui/svelte.config.js +++ b/packages/ui/svelte.config.js @@ -1,18 +1,23 @@ -import adapter from '@sveltejs/adapter-auto'; +import adapter from '@sveltejs/adapter-static'; import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; +const { BASE_URL = "" } = process.env; + /** @type {import('@sveltejs/kit').Config} */ const config = { - // Consult https://kit.svelte.dev/docs/integrations#preprocessors - // for more information about preprocessors - preprocess: vitePreprocess(), + // Consult https://kit.svelte.dev/docs/integrations#preprocessors + // for more information about preprocessors + preprocess: vitePreprocess(), - 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() - } + kit: { + paths: { + base: BASE_URL, + }, + // 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() + } }; export default config; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a10af76..80843e3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -127,6 +127,9 @@ importers: '@sveltejs/adapter-auto': specifier: ^3.0.0 version: 3.2.0(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0)))(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0))) + '@sveltejs/adapter-static': + specifier: ^3.0.1 + version: 3.0.1(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0)))(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0))) '@sveltejs/kit': specifier: ^2.0.0 version: 2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0)))(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0)) @@ -2863,6 +2866,10 @@ snapshots: dependencies: '@sveltejs/kit': 2.5.7(@sveltejs/vite-plugin-svelte@3.0.0-next.3(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0)))(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0)) + '@sveltejs/adapter-static@3.0.1(@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0)))(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0)))': + dependencies: + '@sveltejs/kit': 2.5.7(@sveltejs/vite-plugin-svelte@3.1.0(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0)))(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0)) + '@sveltejs/kit@2.5.7(@sveltejs/vite-plugin-svelte@3.0.0-next.3(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0)))(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0))': dependencies: '@sveltejs/vite-plugin-svelte': 3.0.0-next.3(svelte@5.0.0-next.118)(vite@5.2.10(@types/node@20.12.7)(sass@1.75.0))