-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvite.config.ts
67 lines (65 loc) · 1.54 KB
/
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
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
66
67
import react from '@vitejs/plugin-react';
import autoprefixer from 'autoprefixer';
import path from 'path';
import { fileURLToPath } from 'url';
import { defineConfig } from 'vite';
import EnvironmentPlugin from 'vite-plugin-environment';
import tsconfigPaths from 'vite-tsconfig-paths';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), tsconfigPaths(), EnvironmentPlugin('all')],
resolve: {
alias: {
'~uswds': path.resolve(__dirname, 'node_modules/@uswds/uswds'),
},
},
css: {
preprocessorOptions: {
scss: {
api: 'legacy',
includePaths: ['node_modules/@uswds/uswds/packages'],
},
},
postcss: {
plugins: [autoprefixer],
},
},
server: {
open: true,
port: 8080,
proxy: {
'/api': {
target: 'http://0.0.0.0:5000',
changeOrigin: true,
},
},
},
test: {
globals: true,
environment: 'jsdom',
setupFiles: './vitest.setup.ts',
exclude: ['node_modules/**', 'e2e/**'],
coverage: {
all: false,
provider: 'v8',
thresholds: {
global: {
statements: 95,
branches: 95,
functions: 95,
lines: 95,
},
},
},
css: false,
alias: {
// This is necessary to prevent cjs/esm conflicts
'@metrostar/comet-uswds': path.resolve(
__dirname,
'node_modules/@metrostar/comet-uswds/dist/esm/index.js',
),
},
},
});