-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnetlify.toml
More file actions
63 lines (51 loc) · 2.11 KB
/
Copy pathnetlify.toml
File metadata and controls
63 lines (51 loc) · 2.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
51
52
53
54
55
56
57
58
59
60
61
62
63
# ✅ Netlify Build Configuration for TetraCryptPQC_Nexus
[build]
command = "bun run build" # Ensure Bun builds the project correctly
publish = "dist" # Correct publish directory for Netlify
functions = "disabled" # Explicitly disable Netlify Functions
timeout = 1800 # Increases timeout to prevent build failures on large projects
# ✅ Ensure Secure Build Environment
[build.environment]
NODE_VERSION = "20" # Latest stable Node.js version
BUN_VERSION = "1.0.30" # Ensure correct Bun version
VITE_WASM_ENABLED = "true" # Enables WebAssembly support in Vite
VITE_OPTIMIZE_WASM = "true" # Ensures optimized WebAssembly handling
NPM_FLAGS = "--legacy-peer-deps" # Fixes potential dependency resolution issues
CI = "true" # Ensures builds fail on errors in CI/CD environments
# ✅ Development Server Configuration (Local Testing)
[dev]
command = "bun run dev"
publish = "dist"
port = 8080
# ✅ Redirects & Security Headers
[[headers]]
for = "/*"
[headers.values]
# 🔒 Enforce HTTPS for all traffic
Strict-Transport-Security = "max-age=63072000; includeSubDomains; preload"
# 🔐 Prevent Clickjacking Attacks
X-Frame-Options = "DENY"
# 📦 Prevent MIME Sniffing Attacks
X-Content-Type-Options = "nosniff"
# 🔏 Enable XSS Protection
X-XSS-Protection = "1; mode=block"
# 🌐 Secure Content Security Policy (CSP)
Content-Security-Policy = "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; object-src 'none'; style-src 'self' 'unsafe-inline'; frame-ancestors 'none'"
# ✅ Optimize Caching & Performance
[[headers]]
for = "/assets/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# ✅ Fix SPA (Single Page App) Routing Issues
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
# ✅ Debugging & Build Logging
[build.processing]
skip_processing = false # Ensures all Netlify optimizations run correctly
# ✅ Set Default Fallback for API Calls
[[redirects]]
from = "/api/*"
to = "/api/index.js"
status = 200