-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
53 lines (49 loc) · 1.04 KB
/
Copy pathvite.config.ts
File metadata and controls
53 lines (49 loc) · 1.04 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
// eslint-env node
import { playwright } from '@vitest/browser-playwright';
import { readFileSync } from 'node:fs';
import type { UserConfig } from 'vite';
import { defineConfig } from 'vitest/config';
// oxlint-disable-next-line import/no-default-export
export default defineConfig(({ mode }) => {
const sslOptions = mode === 'production'
? undefined
: {
cert: readFileSync('./certs/server.crt', 'utf-8'),
key: readFileSync('./certs/server.key', 'utf-8')
};
const config: UserConfig = {
envPrefix: 'APP_',
envDir: '../',
root: 'src',
publicDir: '../public',
clearScreen: false,
server: {
https: sslOptions,
host: 'localhost',
open: false,
cors: true,
port: 3000
},
build: {
target: 'esnext',
emptyOutDir: true,
outDir: '../dist'
},
preview: {
https: sslOptions,
open: true,
cors: true
},
test: {
browser: {
enabled: true,
provider: playwright(),
// https://vitest.dev/config/browser/playwright
instances: [
{ browser: 'chromium' }
]
}
}
};
return config;
});