-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
33 lines (31 loc) · 891 Bytes
/
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
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
import { loadEnv } from 'vite';
import fs from 'fs';
export default ({ mode }: { mode: string }) => {
Object.assign(process.env, loadEnv(mode, process.cwd()));
return defineConfig({
plugins: [sveltekit()],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
},
server: {
// host: process.env.VITE_DEV_HOST || 'localhost',
host: true,
port: parseInt(process.env.VITE_DEV_PORT || '8080', 10),
https: {
cert: process.env.VITE_CERT_FILE
? fs.readFileSync(process.env.VITE_CERT_FILE)
: undefined,
key: process.env.VITE_KEY_FILE
? fs.readFileSync(process.env.VITE_KEY_FILE)
: undefined
}
},
build: {
rollupOptions: {
external: [/^\/generated\//]
}
}
});
};