voice_audio_multi/webui/native/svelte.config.js
Fabio c36510c21e
Some checks failed
Linux Build / Linux cpu (push) Has been cancelled
Linux Build / Linux cpu-clang (push) Has been cancelled
Linux Build / Linux vulkan (push) Has been cancelled
mac-build / macOS CPU (push) Has been cancelled
Nix Build / Nix (cpu) (push) Has been cancelled
Nix Build / Nix (vulkan) (push) Has been cancelled
windows-build / Windows CPU (push) Has been cancelled
Initial import: audio.cpp with Orange Pi documentation
2026-11-04 19:05:22 +01:00

51 lines
1.7 KiB
JavaScript

import { readFileSync } from 'node:fs';
import adapter from '@sveltejs/adapter-static';
// SvelteKit defaults kit.version.name to Date.now() and derives the
// __sveltekit_<id> global it embeds in dist/index.html from it, so two builds
// of identical source differ. dist/index.html is committed -- it is embedded
// into the server binary at configure time, which is what lets the project
// build a working server without a JavaScript toolchain -- so any two branches
// that rebuild the web UI conflict in it whether or not their source changes
// overlap.
//
// Naming the version after the UI package makes the bundle a pure function of
// the source tree. Keep webui/native/package.json's version in step with the
// release it ships in; nothing derives it automatically, because audio.cpp's
// own version is tag-driven (AUDIOCPP_VERSION is passed at configure time and
// is not committed anywhere in the tree).
//
// Note that this is an identifier, not a live update channel: the app never
// imports SvelteKit's `updated` store, version.pollInterval is left at its
// default of 0, and the single-file bundle ships no _app/version.json for the
// client to poll. A stale version here costs nothing but a stale label.
const { version } = JSON.parse(
readFileSync(new URL('./package.json', import.meta.url), 'utf8')
);
/** @type {import('@sveltejs/kit').Config} */
const config = {
kit: {
adapter: adapter({
pages: 'dist',
assets: 'dist',
fallback: 'index.html',
strict: true
}),
output: {
bundleStrategy: 'inline'
},
router: {
type: 'hash'
},
paths: {
relative: true
},
version: {
name: version
}
}
};
export default config;