-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnetlify.toml
More file actions
111 lines (90 loc) · 2.51 KB
/
netlify.toml
File metadata and controls
111 lines (90 loc) · 2.51 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Netlify Configuration File
# https://docs.netlify.com/configure-builds/file-based-configuration/
[build]
# Directory with build output
publish = "dist"
# Build command
command = "npm run build"
[build.environment]
# Node version
NODE_VERSION = "20"
NPM_VERSION = "10"
# Install devDependencies (required for TypeScript, Vite, etc.)
NPM_CONFIG_PRODUCTION = "false"
# Redirect rules (backup to _redirects file)
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
[[redirects]]
from = "/*"
to = "/404.html"
status = 404
# Plugin configuration
[[plugins]]
package = "@netlify/plugin-lighthouse"
# Optional: Configure Lighthouse thresholds
[plugins.inputs.thresholds]
performance = 0.9
accessibility = 0.9
best-practices = 0.9
seo = 0.9
[plugins.inputs]
output_path = "reports/lighthouse.html"
# Headers (backup to _headers file)
[[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"
Permissions-Policy = "geolocation=(), microphone=(), camera=(), payment=(), usb=(), magnetometer=(), gyroscope=()"
# HTML: revalidate so users get updated meta and script references quickly
[[headers]]
for = "/"
[headers.values]
Cache-Control = "public, max-age=0, must-revalidate"
[[headers]]
for = "/index.html"
[headers.values]
Cache-Control = "public, max-age=0, must-revalidate"
# SEO: allow crawlers to cache sitemap and robots (1 day)
[[headers]]
for = "/sitemap.xml"
[headers.values]
Cache-Control = "public, max-age=86400"
[[headers]]
for = "/robots.txt"
[headers.values]
Cache-Control = "public, max-age=86400"
[[headers]]
for = "/assets/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "/*.js"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "/*.css"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "/icons/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
[[headers]]
for = "/images/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# Development context
[context.deploy-preview]
command = "npm run build"
[context.branch-deploy]
command = "npm run build"
# Production context
[context.production]
command = "npm run build"
[context.production.environment]
NODE_ENV = "production"