Skip to content

Commit 6af4752

Browse files
Antariscursoragent
andcommitted
fix: serve Dustbound privacy with HTTP 200
GitHub Pages 404.html still returns 404 status; emit a real path so Play Console crawlers can fetch the policy. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent a9c1f60 commit 6af4752

2 files changed

Lines changed: 15 additions & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "tsc -b && vite build && node -e \"require('fs').copyFileSync('dist/index.html','dist/404.html')\"",
8+
"build": "tsc -b && vite build && node scripts/spa-fallback.mjs",
99
"lint": "eslint .",
1010
"preview": "vite preview"
1111
},

scripts/spa-fallback.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { copyFileSync, mkdirSync } from 'node:fs'
2+
import { dirname } from 'node:path'
3+
4+
// GitHub Pages returns HTTP 404 for missing paths even when 404.html is the SPA shell.
5+
// Emit a real file for the privacy route so crawlers and Play Console get HTTP 200.
6+
const routes = ['products/dustbound/privacy']
7+
8+
copyFileSync('dist/index.html', 'dist/404.html')
9+
10+
for (const route of routes) {
11+
const dest = `dist/${route}/index.html`
12+
mkdirSync(dirname(dest), { recursive: true })
13+
copyFileSync('dist/index.html', dest)
14+
}

0 commit comments

Comments
 (0)