-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
vite.config.ts
60 lines (58 loc) · 2.04 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import * as child_process from 'node:child_process';
import { paraglide } from '@inlang/paraglide-js-adapter-sveltekit/vite';
import { enhancedImages } from '@sveltejs/enhanced-img';
import { sveltekit } from '@sveltejs/kit/vite';
import { vercelToolbar } from '@vercel/toolbar/plugins/vite';
import houdini from 'houdini/vite';
import { defineConfig } from 'vitest/config';
// if (!existsSync('config/certs/traefik.me.crt')) {
// console.log('Missing HTTPS key/cert. You may need to run: npm run cert');
// }
// TODO Lightning CSS and tailwind v4 https://twitter.com/devongovett/status/1701097560155549756
export default defineConfig({
server: {
host: 'console.traefik.me',
// host: 'console-192-168-XX-XX.traefik.me',
https: {
cert: 'config/certs/traefik.me.crt',
key: 'config/certs/traefik.me.key',
},
proxy: {},
},
plugins: [
houdini(),
enhancedImages(),
sveltekit(),
paraglide({
project: './project.inlang',
outdir: './src/i18n',
}),
vercelToolbar(),
],
define: {
// to burn-in release version in the footer.svelte
__APP_VERSION__: JSON.stringify(process.env.npm_package_version),
// fallback values: BUILD_VERSION and BUILD_TIME are passed as --build-arg to docker build
__GIT_TAG__: JSON.stringify(
child_process.execSync('git describe --tags || git rev-parse --short HEAD').toString().trim() ??
process.env.BUILD_VERSION,
),
__GIT_DATE__: JSON.stringify(
child_process.execSync('git log -1 --format=%cd --date=format:"%Y-%m-%d %H:%M"').toString().trim() ??
process.env.BUILD_TIME,
),
},
test: {
include: ['src/**/*.{test,spec}.{js,ts}'],
},
// Ref: https://vitejs.dev/guide/dep-pre-bundling#monorepos-and-linked-dependencies
// Ref: https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#what-is-going-on-with-vite-and-pre-bundling-dependencies
optimizeDeps: {
include: ['@spectacular/skeleton'],
},
build: {
commonjsOptions: {
include: [/@spectacular-skeleton/, /node_modules/],
},
},
});