-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
39 lines (37 loc) · 1.07 KB
/
Copy pathvite.config.ts
File metadata and controls
39 lines (37 loc) · 1.07 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
import { fileURLToPath } from 'node:url';
import babel from '@rolldown/plugin-babel';
import tailwindcss from '@tailwindcss/vite';
import react, { reactCompilerPreset } from '@vitejs/plugin-react';
import { codeInspectorPlugin } from 'code-inspector-plugin';
import { defineConfig, loadEnv } from 'vite';
import { routeBuilderPlugin } from 'vite-plugin-route-builder';
export default defineConfig(({ mode }) => ({
define: {
'import.meta.env.VITE_SITE_URL': JSON.stringify(
loadEnv(mode, process.cwd(), '').VITE_SITE_URL?.replace(/\/$/, '') ?? '',
),
},
resolve: {
alias: {
'~': fileURLToPath(new URL('./src', import.meta.url)),
},
},
optimizeDeps: {
entries: ['index.html'],
},
plugins: [
codeInspectorPlugin({
bundler: 'vite',
editor: 'cursor',
hotKeys: ['altKey'],
}),
react(),
babel({ presets: [reactCompilerPreset()] }),
tailwindcss(),
routeBuilderPlugin({
pagePattern: './src/pages/**/*.{tsx,sync.tsx}',
outputPath: './src/generated-routes.ts',
enableInDev: true,
}),
],
}));