-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvite.config.ts
More file actions
87 lines (85 loc) · 2.59 KB
/
vite.config.ts
File metadata and controls
87 lines (85 loc) · 2.59 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import * as child_process from 'node:child_process';
import { existsSync } from 'node:fs';
import { paraglide } from '@inlang/paraglide-sveltekit/vite';
import { enhancedImages } from '@sveltejs/enhanced-img';
import { sveltekit } from '@sveltejs/kit/vite';
import { svelteTesting } from '@testing-library/svelte/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. follow the workspace README file to install certs');
}
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(),
paraglide({
project: './project.inlang',
outdir: './src/i18n',
strategy: ['url', 'cookie', 'baseLocale'],
}),
vercelToolbar(),
// svelte({ hot: !process.env.VITEST }),
sveltekit(),
],
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
),
},
ssr: {
// noExternal: ["@nhost/nhost-js", "graphql"],
noExternal: ['@inlang/paraglide-js'],
},
test: {
projects: [
{
extends: './vite.config.ts',
plugins: [svelteTesting()],
test: {
name: 'client',
environment: 'jsdom',
clearMocks: true,
include: ['src/**/*.svelte.{test,spec}.{js,ts}'],
exclude: ['src/lib/server/**'],
setupFiles: ['./vitest.setup.ts'],
},
},
{
extends: './vite.config.ts',
test: {
name: 'server',
environment: 'node',
include: ['src/**/*.{test,spec}.{js,ts}'],
exclude: ['src/**/*.svelte.{test,spec}.{js,ts}'],
},
},
],
},
// optimizeDeps: {
// include: ['@repo/skeleton'],
// },
// build: {
// commonjsOptions: {
// include: [/@repo-skeleton/, /node_modules/],
// },
// },
});