-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
65 lines (64 loc) · 1.8 KB
/
vite.config.ts
File metadata and controls
65 lines (64 loc) · 1.8 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
/// <reference types="vitest" />
import { defineConfig } from 'vite';
import path from 'path';
import { transcriptPersistPlugin } from './scripts/vite-transcript-plugin';
export default defineConfig(({ mode, command }) => ({
// Use the repo sub-path for production builds (GitHub Pages);
// keep '/' for local development so localhost:3000 works as expected.
base: mode === 'production' ? '/Tableau-Card-Engine/' : '/',
plugins: [
// Only register the transcript persistence plugin during dev server
...(command === 'serve' ? [transcriptPersistPlugin()] : []),
],
resolve: {
alias: {
'@core-engine': path.resolve(__dirname, 'src/core-engine'),
'@card-system': path.resolve(__dirname, 'src/card-system'),
'@rule-engine': path.resolve(__dirname, 'src/rule-engine'),
'@ui': path.resolve(__dirname, 'src/ui'),
'@ai': path.resolve(__dirname, 'src/ai'),
},
},
build: {
outDir: 'dist',
sourcemap: true,
},
server: {
port: 3000,
open: false,
},
test: {
projects: [
{
extends: true,
test: {
name: 'unit',
globals: true,
environment: 'node',
include: ['tests/**/*.test.ts'],
exclude: ['tests/**/*.browser.test.ts'],
testTimeout: 15_000,
},
},
{
extends: true,
test: {
name: 'browser',
include: ['tests/**/*.browser.test.ts'],
fileParallelism: false,
sequence: {
concurrent: false,
},
testTimeout: 30_000,
browser: {
enabled: true,
provider: 'playwright',
headless: true,
instances: [{ browser: 'chromium' }],
viewport: { width: 900, height: 700 },
},
},
},
],
},
}));