Add Cloudflare Pages deploy script and config
This commit is contained in:
@@ -3,3 +3,4 @@ dist
|
||||
.DS_Store
|
||||
*.local
|
||||
.vite
|
||||
.wrangler
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
# wrangler login caches an OAuth token under ~/.config/.wrangler; re-running
|
||||
# login when already authenticated would pointlessly re-open the browser.
|
||||
if ! pnpm exec wrangler whoami 2>/dev/null | grep -qi "logged in"; then
|
||||
echo "Not logged in to Cloudflare — opening browser for OAuth login..."
|
||||
pnpm exec wrangler login
|
||||
fi
|
||||
|
||||
echo "Building..."
|
||||
pnpm build
|
||||
|
||||
echo "Deploying dist/ to Cloudflare Pages..."
|
||||
pnpm exec wrangler pages deploy
|
||||
+4
-2
@@ -10,7 +10,8 @@
|
||||
"preview": "vite preview",
|
||||
"check": "svelte-check --tsconfig ./tsconfig.json",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest"
|
||||
"test:watch": "vitest",
|
||||
"deploy:cf": "./deploy.sh"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
||||
@@ -20,7 +21,8 @@
|
||||
"svelte-check": "^4.1.4",
|
||||
"typescript": "^5.7.3",
|
||||
"vite": "^6.0.11",
|
||||
"vitest": "^3.0.4"
|
||||
"vitest": "^3.0.4",
|
||||
"wrangler": "^4.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"tonal": "^6.4.0"
|
||||
|
||||
Generated
+809
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
name = "guitar-practice-tool"
|
||||
compatibility_date = "2026-07-23"
|
||||
pages_build_output_dir = "dist"
|
||||
Reference in New Issue
Block a user