-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
executable file
·46 lines (44 loc) · 1.1 KB
/
vite.config.js
File metadata and controls
executable file
·46 lines (44 loc) · 1.1 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
43
44
45
46
import path from 'path';
import react from '@vitejs/plugin-react';
import { fileURLToPath } from 'url';
import { defineConfig } from 'vite';
import { intlayerPlugin } from 'vite-intlayer';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// https://vite.dev/config/
export default defineConfig({
root: 'apps/client',
publicDir: '../../public',
envDir: '../..', // Load environment variables from root directory
plugins: [react(), intlayerPlugin()],
define: {
global: 'globalThis',
},
server: {
cors: true,
port: 3000,
strictPort: true,
host: '0.0.0.0',
proxy: {
'/api': {
target: 'http://localhost:3001',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/api/, '/api'),
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'apps/client/src'),
'@services': path.resolve(__dirname, 'apps/client/src/services'),
libs: path.resolve(__dirname, 'libs'),
},
},
optimizeDeps: {
include: ['zod', '@hookform/resolvers/zod'],
},
ssr: {
noExternal: ['@clerk/clerk-react', 'react-hot-toast'],
},
});