This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

core / web / vite.config.ts
1.5 kB 52 lines
1import tailwindcss from '@tailwindcss/vite'; 2import { sveltekit } from '@sveltejs/kit/vite'; 3import Icons from 'unplugin-icons/vite'; 4import { defineConfig } from 'vitest/config'; 5import oauthMetadata from './static/oauth-client-metadata.json'; 6 7const devHost = process.env.VITE_DEV_HOST ?? '127.0.0.1'; 8const devPort = Number(process.env.VITE_DEV_PORT ?? 5173); 9const devRedirectUri = `http://127.0.0.1:${devPort}/oauth/callback`; 10const devClientId = `http://localhost?redirect_uri=${encodeURIComponent(devRedirectUri)}&scope=${encodeURIComponent(oauthMetadata.scope)}`; 11 12export default defineConfig({ 13 plugins: [ 14 { 15 name: 'oauth-env', 16 config(_config, { command }) { 17 process.env.VITE_OAUTH_CLIENT_ID ??= 18 command === 'serve' ? devClientId : oauthMetadata.client_id; 19 process.env.VITE_OAUTH_REDIRECT_URI ??= 20 command === 'serve' ? devRedirectUri : oauthMetadata.redirect_uris[0]; 21 process.env.VITE_OAUTH_SCOPE ??= oauthMetadata.scope; 22 } 23 }, 24 tailwindcss(), 25 Icons({ compiler: 'svelte' }), 26 sveltekit() 27 ], 28 resolve: { 29 alias: { 30 '$icon/': '~icons/lucide/' 31 } 32 }, 33 server: { 34 host: devHost, 35 port: devPort, 36 strictPort: true 37 }, 38 test: { 39 expect: { requireAssertions: true }, 40 projects: [ 41 { 42 extends: './vite.config.ts', 43 test: { 44 name: 'server', 45 environment: 'node', 46 include: ['src/**/*.{test,spec}.{js,ts}'], 47 exclude: ['src/**/*.svelte.{test,spec}.{js,ts}'] 48 } 49 } 50 ] 51 } 52});