feat: add automatic Cloudflare Pages zip packager and _redirects
husteno-o committed 1 months ago
d2a4024
1 parent 5ae967f
commit d2a4024
3 files changed
+8 -0
Showing 3 changed files+8-0
▼.gitignore
+1-0
| @@ -10,4 +10,5 @@ dist/ | ||
10 | 10 | .env.*.local |
11 | 11 | *.log |
12 | 12 | coverage/ |
13 | +*.zip | |
13 | 14 | .DS_Store |
14 | 15 | |
▼apps/web/build.ts
+6-0
| @@ -38,4 +38,10 @@ if (existsSync(publicDir)) { | ||
38 | 38 | await cp(publicDir, distDir, { recursive: true }); |
39 | 39 | } |
40 | 40 | |
41 | +// Generate ready-to-upload zip archive for Cloudflare Pages Direct Upload | |
42 | +const rootDir = path.resolve(projectRoot, "../.."); | |
43 | +const zipPath = path.join(rootDir, "devpulse-cloudflare-pages.zip"); | |
44 | +Bun.spawnSync(["zip", "-r", "-q", zipPath, "."], { cwd: distDir }); | |
45 | + | |
41 | 46 | console.log("Landing page build completed successfully in apps/web/dist!"); |
47 | +console.log(`Cloudflare Pages drag-and-drop zip package created at: ${zipPath}`); | |
42 | 48 | |
▼apps/web/public/_redirects
+1-0
| @@ -0,0 +1 @@ | ||
1 | +/* /index.html 200 | |
0 | 2 | |