feat: add base path for deploy

This commit is contained in:
2026-08-25 10:36:10 +05:00
parent b296b6fa20
commit 6d770dc642
3 changed files with 18 additions and 4 deletions
+12
View File
@@ -2,12 +2,24 @@ import adapter from '@sveltejs/adapter-static';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
declare const process: { env: Record<string, string | undefined> };
const rawBase = (process.env.BASE_PATH ?? '').trim();
const base: '' | `/${string}` =
rawBase === '' || rawBase === '/'
? ''
: (`/${rawBase.replace(/^\/+/, '').replace(/\/+$/, '')}` as `/${string}`);
export default defineConfig({
ssr: {
noExternal: ['@lucide/svelte']
},
plugins: [
sveltekit({
paths: {
base
},
compilerOptions: {
// Force runes mode for the project, except for libraries. Can be removed in svelte 6.
runes: ({ filename }) =>