-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnetlify.toml
More file actions
90 lines (72 loc) · 2.24 KB
/
netlify.toml
File metadata and controls
90 lines (72 loc) · 2.24 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
[build]
# Directory to change to before starting a build
base = "."
# Directory that contains the deploy-ready HTML files and assets generated by the build
publish = "dist"
# Build command that ensures dependencies are installed
command = "npm ci && npm run build"
[build.environment]
# Node.js version
NODE_VERSION = "18"
# Redirect all routes to index.html for SPA routing
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
# Security headers
[[headers]]
for = "/*"
[headers.values]
# Security headers
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
X-Content-Type-Options = "nosniff"
Referrer-Policy = "strict-origin-when-cross-origin"
# HTTPS enforcement
Strict-Transport-Security = "max-age=31536000; includeSubDomains; preload"
# Cache control for static assets
Cache-Control = "public, max-age=31536000"
# Specific headers for HTML files
[[headers]]
for = "/*.html"
[headers.values]
Cache-Control = "public, max-age=0, must-revalidate"
# Headers for XML/TXT files (sitemap, robots, etc.)
[[headers]]
for = "/*.xml"
[headers.values]
Content-Type = "application/xml; charset=utf-8"
Cache-Control = "public, max-age=86400"
[[headers]]
for = "/*.txt"
[headers.values]
Content-Type = "text/plain; charset=utf-8"
Cache-Control = "public, max-age=86400"
# Headers for manifest.json
[[headers]]
for = "/manifest.json"
[headers.values]
Content-Type = "application/manifest+json; charset=utf-8"
Cache-Control = "public, max-age=86400"
# Headers for service worker if you add one later
[[headers]]
for = "/sw.js"
[headers.values]
Cache-Control = "public, max-age=0, must-revalidate"
# Optimize for performance
[build.processing]
skip_processing = false
[build.processing.css]
bundle = true
minify = true
[build.processing.js]
bundle = true
minify = true
[build.processing.html]
pretty_urls = true
# Functions directory (if you add serverless functions later)
[functions]
directory = "netlify/functions"
# Form handling (if you add contact forms later)
[template.environment]
REACT_APP_SITE_URL = "https://libraryofpi.netlify.app"