-
Notifications
You must be signed in to change notification settings - Fork 3
/
vite.config.mts
81 lines (72 loc) · 1.77 KB
/
vite.config.mts
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/// <reference types='vitest' />
import react from '@vitejs/plugin-react'
import svgr from 'vite-plugin-svgr'
import { defineConfig } from 'vite'
import { viteStaticCopy } from 'vite-plugin-static-copy'
import { nxViteTsPaths } from '@nx/vite/plugins/nx-tsconfig-paths.plugin'
import { TanStackRouterVite } from '@tanstack/router-vite-plugin'
import 'dotenv/config'
export default defineConfig({
root: __dirname,
cacheDir: '../../node_modules/.vite/apps/image-labeler',
server: {
port: 3000,
host: 'localhost',
},
preview: {
port: 3001,
host: 'localhost',
},
plugins: [
react(),
svgr({
include: ['**/*.svg', '**/*.svg?react'],
}),
nxViteTsPaths(),
TanStackRouterVite({
routesDirectory: './apps/image-labeler/src/routes',
generatedRouteTree: './apps/image-labeler/src/routeTree.gen.ts',
}),
viteStaticCopy({
targets: [
{
src: 'nginx.conf',
dest: '',
},
{
src: '../../config/entrypoint.sh',
dest: '',
},
],
}),
],
// Uncomment this if you are using workers.
// worker: {
// plugins: [ nxViteTsPaths() ],
// },
build: {
outDir: '../../dist/apps/image-labeler',
reportCompressedSize: true,
commonjsOptions: {
transformMixedEsModules: true,
},
},
define: {
'process.env': {
API_GATEWAY: process.env.API_GATEWAY,
},
},
// test: {
// globals: true,
// cache: {
// dir: '../../node_modules/.vitest',
// },
// environment: 'jsdom',
// include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
// reporters: ['default'],
// coverage: {
// reportsDirectory: '../../coverage/apps/image-labeler',
// provider: 'v8',
// },
// },
})