-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.js
More file actions
50 lines (45 loc) · 1.11 KB
/
vite.config.js
File metadata and controls
50 lines (45 loc) · 1.11 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
47
48
49
50
import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react-swc';
export default defineConfig(({ mode }) => {
// Load env file based on mode
const env = loadEnv(mode, process.cwd(), '');
return {
build: {
rollupOptions: {
output: {
manualChunks: {
vendor: [],
},
},
},
// Enable chunk size warnings
chunkSizeWarningLimit: 500,
},
plugins: [
react(),
// Replace env variables in HTML at build time
{
name: 'html-transform',
transformIndexHtml(html) {
return html.replace(
/%VITE_GOOGLE_MAPS_API_KEY%/g,
env.VITE_GOOGLE_MAPS_API_KEY || '',
);
},
},
],
optimizeDeps: {
include: ['react-remita'],
},
server: {
force: true,
// Add security headers for development
headers: {
'X-Frame-Options': 'DENY',
'X-Content-Type-Options': 'nosniff',
'X-XSS-Protection': '1; mode=block',
'Referrer-Policy': 'strict-origin-when-cross-origin',
},
},
};
});