-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvite.config.ts
More file actions
45 lines (43 loc) · 1.12 KB
/
vite.config.ts
File metadata and controls
45 lines (43 loc) · 1.12 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
/// <reference types='vitest' />
import { defineConfig } from 'vite';
import { dirname, resolve } from 'path';
import { fileURLToPath } from 'url';
const __dirname = dirname(fileURLToPath(import.meta.url));
const pages = ['ping-am', 'ping-one'];
export default defineConfig({
root: __dirname + '/src',
cacheDir: '../../node_modules/.vite/e2e/oidc-app',
publicDir: __dirname + '/public',
server: {
port: 8443,
host: 'localhost',
},
preview: {
port: 8443,
host: 'localhost',
},
// Uncomment this if you are using workers.
// worker: {
// plugins: [ nxViteTsPaths() ],
// },
build: {
outDir: __dirname + '/dist',
emptyOutDir: true,
reportCompressedSize: true,
rollupOptions: {
input: {
main: resolve(__dirname + '/src', 'index.html'),
...pages.reduce(
(acc, page) => {
acc[page as keyof typeof pages] = resolve(__dirname + '/src', `${page}/index.html`);
return acc;
},
{} as Record<keyof typeof pages, string>,
),
},
output: {
entryFileNames: '[name]/main.js',
},
},
},
});