-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnetlify.toml
More file actions
58 lines (49 loc) · 1.27 KB
/
netlify.toml
File metadata and controls
58 lines (49 loc) · 1.27 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
[build]
# Directory with the build output
publish = "dist"
# Build command
command = "npm ci && npm run build"
# Environment variables for build
[build.environment]
NODE_VERSION = "20.19.2"
NPM_VERSION = "10.9.2"
NODE_ENV = "production"
# Headers for security and performance
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-Content-Type-Options = "nosniff"
X-XSS-Protection = "1; mode=block"
Referrer-Policy = "strict-origin-when-cross-origin"
# Cache static assets for 1 year
[[headers]]
for = "/static/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# Cache bundle files for 1 year
[[headers]]
for = "*.js"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "*.css"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# Redirect rules for SPA (Single Page Application)
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
conditions = {Role = ["admin"]}
# Handle SPA routing
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
# Redirect old domain if needed
# [[redirects]]
# from = "https://trode.netlify.app/*"
# to = "https://troud.netlify.app/:splat"
# status = 301
# force = true