feat(build): static export (index.html ต่อหน้า) สำหรับโฮสต์แบบไฟล์นิ่ง
- scripts/static-export.mjs: ดึง HTML ทุกหน้าจาก production server มาเป็นไฟล์นิ่ง
· index.html, about/, for-cinemas/, for-film-lovers/, cinema/<slug>/ (ทุกโรงที่ไม่ hidden)
· c/<slug>/ = หน้า redirect แบบ meta refresh + JS
· คัดลอก .output/public (assets, รูป, manifest, sw, sitemap, robots) + 404.html
· อ่าน slug จาก data/content/content.json (การ์ดหน้าแรก render ฝั่ง client จึงไม่มี link ใน HTML)
· inject data-static-export-nav: ดักคลิก link ภายในเป็น full page load
(static host ไม่มี endpoint ?_data= ของ React Router)
- package.json: script "export:static" · .gitignore: static-export/
- README: วิธี build/export/ทดสอบ + ข้อจำกัด (ไม่มี /admin, /api, 302, meta อบตอน export)
This commit is contained in:
1 parent
1cf1398ba4
commit
1c38d8e286
4 files changed
+169
No files matched your search
@@ -8,6 +8,7 @@
|
||||
"migrate:production": "tsx scripts/migrate-production.ts && pnpm db:migrate",
|
||||
"dev": "agent-native dev",
|
||||
"build": "agent-native build",
|
||||
"export:static": "node scripts/static-export.mjs",
|
||||
"start": "agent-native start",
|
||||
"typecheck": "agent-native typecheck",
|
||||
"action": "agent-native action",
|
||||
|
||||
Reference in new issue
Block a user