Files
llama.cpp/tools/ui/svelte.config.js
T

39 lines
900 B
JavaScript
Raw Normal View History

2025-09-17 19:29:13 +02:00
import { mdsvex } from 'mdsvex';
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
2026-05-23 17:08:22 -04:00
// CMake sets LLAMA_UI_OUT_DIR to the staging dir under the build tree; manual
// `npm run build` runs without the env var default to ./dist.
const outDir = process.env.LLAMA_UI_OUT_DIR ?? './dist';
2025-09-17 19:29:13 +02:00
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://svelte.dev/docs/kit/integrations
// for more information about preprocessors
preprocess: [vitePreprocess(), mdsvex()],
2025-09-17 19:29:13 +02:00
kit: {
paths: {
relative: true
},
router: { type: 'hash' },
2025-09-17 19:29:13 +02:00
adapter: adapter({
2026-05-23 17:08:22 -04:00
pages: outDir,
assets: outDir,
2025-09-17 19:29:13 +02:00
fallback: 'index.html',
precompress: false,
strict: true
}),
output: {
bundleStrategy: 'single'
},
alias: {
$styles: 'src/styles'
2025-09-17 19:29:13 +02:00
}
},
2025-09-17 19:29:13 +02:00
extensions: ['.svelte', '.svx']
};
export default config;