-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnetlify.toml
More file actions
58 lines (50 loc) · 2.21 KB
/
Copy pathnetlify.toml
File metadata and controls
58 lines (50 loc) · 2.21 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]
command = "npm run build"
publish = "dist"
[build.environment]
NODE_VERSION = "20"
# Single-page app: every unknown path renders the game shell instead of a 404.
# Real files are served before this rule is ever consulted.
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
# Build output (Vite content hashes) and art assets (manual _v1 suffix) both
# change filename whenever their bytes change, so they can be cached forever.
[[headers]]
for = "/assets/*"
[headers.values]
Cache-Control = "public, max-age=31536000, immutable"
# Root-level icons and social image are referenced by fixed names, so they get a
# short cache and must be revalidated.
[[headers]]
for = "/*.png"
[headers.values]
Cache-Control = "public, max-age=86400, must-revalidate"
[[headers]]
for = "/*.jpg"
[headers.values]
Cache-Control = "public, max-age=86400, must-revalidate"
[[headers]]
for = "/manifest.json"
[headers.values]
Cache-Control = "public, max-age=3600, must-revalidate"
# index.html must never be cached, otherwise clients keep loading old asset hashes.
[[headers]]
for = "/index.html"
[headers.values]
Cache-Control = "public, max-age=0, must-revalidate"
[[headers]]
for = "/*"
[headers.values]
X-Content-Type-Options = "nosniff"
X-Frame-Options = "SAMEORIGIN"
Referrer-Policy = "strict-origin-when-cross-origin"
Permissions-Policy = "camera=(), microphone=(), geolocation=(), interest-cohort=()"
Cross-Origin-Opener-Policy = "same-origin"
# The game ships no external scripts and makes no network calls. Google Fonts
# is the only third-party origin left: stylesheet from fonts.googleapis.com,
# font files from fonts.gstatic.com.
# 'unsafe-inline' in style-src covers the inline <style> block in index.html
# and the inline style attributes React writes for HUD animation.
Content-Security-Policy = "default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com data:; img-src 'self' data: blob:; media-src 'self'; connect-src 'self'; worker-src 'self' blob:; manifest-src 'self'; base-uri 'self'; form-action 'self'; frame-ancestors 'self'; object-src 'none'"