-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathvite.config.ts
More file actions
executable file
·40 lines (38 loc) · 1.15 KB
/
Copy pathvite.config.ts
File metadata and controls
executable file
·40 lines (38 loc) · 1.15 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
import stylex from '@stylexjs/unplugin/vite'
import { devtools } from '@tanstack/devtools-vite'
import { tanstackRouter } from '@tanstack/router-plugin/vite'
import react from '@vitejs/plugin-react'
import { resolve } from 'node:path'
import { defineConfig } from 'vite'
const isTestOrCI = process.env.CI || process.env.VITEST
export default defineConfig({
plugins: [
stylex({
useCSSLayers: true,
aliases: { '#/*': resolve('./app/*') }
}),
!isTestOrCI && devtools(),
!isTestOrCI &&
tanstackRouter({
routesDirectory: resolve('./app/routes'),
generatedRouteTree: resolve('./app/routes.gen.ts'),
autoCodeSplitting: true,
target: 'react'
}),
react()
],
envPrefix: ['VITE_', 'PUBLIC_'],
define: { 'import.meta.env.PUBLIC_APP_VERSION': `"${process.env.npm_package_version}"` },
publicDir: resolve('public'),
resolve: { tsconfigPaths: true },
build: {
emptyOutDir: true,
chunkSizeWarningLimit: 1024,
reportCompressedSize: false,
outDir: resolve('dist'),
rolldownOptions: {
input: { app: resolve('index.html') }
}
},
server: { port: 3000, strictPort: true }
})