char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
9c5531e2b
char/aliceai-t5-moe
1import { buildInfoPlugin } from './scripts/vite-plugin-build-info' ; 2import { nerdamerPlugin } from './scripts/vite-plugin-nerdamer' ; 3import { relativizeBasePlugin } from './scripts/vite-plugin-relativize-base' ; 4import { splashScreenPlugin } from './scripts/vite-plugin-splash-screen' ; 5import { SVELTEKIT_PWA_OPTIONS } from './src/lib/constants/pwa.constants' ; 6import { storybookTest } from '@storybook/addon-vitest/vitest-plugin' ; 7import { sveltekit } from '@sveltejs/kit/vite' ; 8import tailwindcss from '@tailwindcss/vite' ; 9import { SvelteKitPWA } from '@vite-pwa/sveltekit' ; 10import { playwright } from '@vitest/browser-playwright' ; 11import { dirname , resolve } from 'path' ; 12import { fileURLToPath } from 'url' ; 13import { defineConfig , loadEnv , searchForWorkspaceRoot } from 'vite' ; 14 15const __dirname = dirname ( fileURLToPath ( import . meta. url )); 16// eslint-disable-next-line @typescript-eslint/no-explicit-any 17const browserBaseConfig :any = { 18enabled :true , 19instances :[{ browser :'chromium' }], 20provider :playwright ({ 21launchOptions :{ 22args :[ '--no-sandbox' ] 23} 24}) 25}; 26 27export default defineConfig (({ mode}) => { 28const env = loadEnv ( mode , process . cwd (), 'VITE_PUBLIC_' ); 29const SERVER_ORIGIN = env . VITE_PUBLIC_SERVER_ORIGIN || 'http://localhost:8080' ; 30 31return { 32build :{ 33assetsInlineLimit :32000 , 34chunkSizeWarningLimit :3072 , 35minify :true 36}, 37 38plugins :[ 39tailwindcss (), 40sveltekit (), 41SvelteKitPWA ( SVELTEKIT_PWA_OPTIONS ), 42splashScreenPlugin (), 43buildInfoPlugin (), 44nerdamerPlugin (), 45relativizeBasePlugin () 46], 47 48resolve :{ 49alias :{ 50'katex-fonts' :resolve ( 'node_modules/katex/dist/fonts' ) 51} 52}, 53 54server :{ 55fs :{ 56allow :[ searchForWorkspaceRoot ( process . cwd ()), resolve ( __dirname , 'tests' )] 57}, 58headers :{ 59'Cross-Origin-Embedder-Policy' :'require-corp' , 60'Cross-Origin-Opener-Policy' :'same-origin' 61}, 62proxy :{ 63'/cors-proxy' :SERVER_ORIGIN , 64'/models' :SERVER_ORIGIN , 65'/props' :SERVER_ORIGIN , 66'/slots' :SERVER_ORIGIN , 67'/tools' :SERVER_ORIGIN , 68'/v1' :SERVER_ORIGIN 69} 70}, 71 72test :{ 73projects :[ 74{ 75extends :'./vite.config.ts' , 76test :{ 77browser :browserBaseConfig , 78include :[ 'tests/client/**/*.svelte.{test,spec}.{js,ts}' ], 79name :'client' , 80setupFiles :[ './vitest-setup-client.ts' ] 81} 82}, 83 84{ 85extends :'./vite.config.ts' , 86test :{ 87environment :'node' , 88include :[ 'tests/unit/**/*.{test,spec}.{js,ts}' ], 89name :'unit' 90} 91}, 92 93{ 94extends :'./vite.config.ts' , 95plugins :[ 96storybookTest ({ 97storybookScript :'pnpm run storybook --no-open' 98}) 99], 100test :{ 101browser :{ ...browserBaseConfig , instances :[{ browser :'chromium' , headless :true }] }, 102name :'ui' 103} 104} 105] 106} 107}; 108});