Compare commits

6 Commits

Author SHA1 Message Date
acc23b13b6 fix(frontend): add ASSETS binding for worker assets 2026-03-11 21:42:52 +08:00
1d84107147 fix(frontend): add KV namespace to production env 2026-03-11 21:38:32 +08:00
f17523fd91 fix(frontend): add SESSION KV namespace binding
Required by @astrojs/cloudflare adapter for session persistence.
2026-03-11 21:37:35 +08:00
e7344fa7fe fix(frontend): disable Cloudflare KV session persistence
Session KV binding was causing deployment error. Since the project
doesn't use sessions, disable persistence to avoid the binding requirement.
2026-03-11 21:35:51 +08:00
b5a8e9a1e6 chore: 新增 .assetsignore 檔案以忽略 _worker.js 2026-03-11 21:31:53 +08:00
03760b23a5 chore(frontend): consolidate wrangler config to jsonc
- Remove redundant wrangler.toml (old Pages config)
- Rename worker from enchun-frontend to website-enchun-mgr
- Keep wrangler.jsonc as single source of truth
2026-03-11 18:48:13 +08:00
5 changed files with 21 additions and 13 deletions

View File

@@ -0,0 +1 @@
_worker.js

View File

@@ -13,6 +13,9 @@ export default defineConfig({
enabled: true,
configPath: './wrangler.jsonc',
},
session: {
persistence: 'none',
},
}),
vite: {
plugins: [tailwindcss()],

View File

@@ -6,7 +6,7 @@
"scripts": {
"dev": "astro dev --host --port 4321",
"dev:pages": "wrangler pages dev --compatibility-date=2024-01-01",
"build": "astro build",
"build": "astro build && cp .assetsignore dist/",
"preview": "astro preview",
"check": "astro check",
"typecheck": "astro check",

View File

@@ -1,20 +1,33 @@
{
"$schema": "./node_modules/wrangler/config-schema.json",
"name": "enchun-frontend",
"name": "website-enchun-mgr",
"main": "./dist/_worker.js/index.js",
"compatibility_date": "2025-01-19",
"compatibility_flags": [
"nodejs_compat"
],
"assets": {
"directory": "./dist"
"directory": "./dist",
"binding": "ASSETS"
},
"kv_namespaces": [
{
"binding": "SESSION",
"id": "0de94ad20be24add94c1f8fe9c4a0440"
}
],
"vars": {
"PAYLOAD_CMS_URL": "https://enchun-admin.anlstudio.cc"
},
"env": {
"production": {
"name": "enchun-frontend-production",
"name": "website-enchun-mgr-production",
"kv_namespaces": [
{
"binding": "SESSION",
"id": "0de94ad20be24add94c1f8fe9c4a0440"
}
],
"vars": {
"PAYLOAD_CMS_URL": "https://enchun-admin.anlstudio.cc"
}

View File

@@ -1,9 +0,0 @@
name = "enchun-frontend"
compatibility_date = "2024-01-01"
pages_build_output_dir = "dist"
[vars]
PAYLOAD_CMS_URL = "https://enchun-admin.anlstudio.cc"
[env.production.vars]
PAYLOAD_CMS_URL = "https://enchun-admin.anlstudio.cc"