|
1
|
import tailwindcss from '@tailwindcss/vite'; |
|
2
|
import react from '@vitejs/plugin-react'; |
|
3
|
import path from 'path'; |
|
4
|
import {defineConfig} from 'vite'; |
|
5
|
|
|
6
|
export default defineConfig(() => { |
|
7
|
return { |
|
8
|
plugins: [react(), tailwindcss()], |
|
9
|
resolve: { |
|
10
|
alias: { |
|
11
|
'@': path.resolve(__dirname, 'src'), |
|
12
|
'@shared': path.resolve(__dirname, 'shared'), |
|
13
|
}, |
|
14
|
}, |
|
15
|
server: { |
|
16
|
// HMR is disabled in AI Studio via DISABLE_HMR env var. |
|
17
|
// Do not modifyâfile watching is disabled to prevent flickering during agent edits. |
|
18
|
hmr: process.env.DISABLE_HMR !== 'true', |
|
19
|
// Disable file watching when DISABLE_HMR is true to save CPU during agent edits. |
|
20
|
watch: process.env.DISABLE_HMR === 'true' ? null : {}, |
|
21
|
}, |
|
22
|
}; |
|
23
|
}); |