-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvite.config.ts
More file actions
55 lines (53 loc) · 1.39 KB
/
vite.config.ts
File metadata and controls
55 lines (53 loc) · 1.39 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
/// <reference types='vitest' />
import { defineConfig } from 'vite';
import * as path from 'path';
const pages = ['oath', 'push', 'webauthn', 'device-binding', 'device-profile'];
export default defineConfig({
root: __dirname + '/src',
cacheDir: '../../node_modules/.vite/e2e/device-client-app',
publicDir: __dirname + '/public',
server: {
cors: true,
port: 8443,
host: 'localhost',
headers: {
'Access-Control-Allow-Credentials': 'true',
'Access-Control-Allow-Origin': 'null',
'Access-Control-Allow-Headers': 'x-authorize-middleware',
},
},
preview: {
port: 8443,
host: 'localhost',
headers: {
'Access-Control-Allow-Origin': 'http://localhost:8443',
},
},
// Uncomment this if you are using workers.
// worker: {
// plugins: [ nxViteTsPaths() ],
// },
build: {
outDir: __dirname + '/dist',
emptyOutDir: true,
reportCompressedSize: true,
rollupOptions: {
input: {
main: path.resolve(__dirname + '/src', 'index.html'),
...pages.reduce(
(acc, page) => {
acc[page as keyof typeof pages] = path.resolve(
__dirname + '/src',
`${page}/index.html`,
);
return acc;
},
{} as Record<keyof typeof pages, string>,
),
},
output: {
entryFileNames: '[name]/main.js',
},
},
},
});