-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
42 lines (39 loc) · 1.13 KB
/
vite.config.ts
File metadata and controls
42 lines (39 loc) · 1.13 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
import { defineConfig } from 'vite'
import { resolve } from 'path'
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
import viteReact from '@vitejs/plugin-react'
import viteTsConfigPaths from 'vite-tsconfig-paths'
import tailwindcss from '@tailwindcss/vite'
import devtoolsJson from 'vite-plugin-devtools-json'
import { nitroV2Plugin } from '@tanstack/nitro-v2-vite-plugin'
const forSites = process.env?.FOR_SITES === 'true'
const config = defineConfig({
plugins: [
// this is the plugin that enables path aliases
viteTsConfigPaths({
projects: ['./tsconfig.json'],
}),
tailwindcss(),
tanstackStart(),
forSites &&
nitroV2Plugin({
compatibilityDate: '2025-10-08',
preset: 'node',
}),
devtoolsJson(),
viteReact(),
],
server: {
host: '::',
allowedHosts: true,
hmr: true,
},
resolve: {
alias: {
// Stub lowlight to prevent highlight.js errors since we use Prism
'lowlight': resolve(__dirname, './src/lib/lowlight-stub'),
'lowlight/lib/core': resolve(__dirname, './src/lib/lowlight-stub/lib/core'),
},
},
})
export default config