From b7da81c5d4813c4164895e4490d7ecc8b15a9feb Mon Sep 17 00:00:00 2001 From: LC mac Date: Thu, 29 Jan 2026 00:21:26 +0800 Subject: [PATCH] chore: configure vite for GitHub Pages deployment --- scripts/deploy.sh | 20 ++++++++++++-------- vite.config.ts | 13 +++---------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 201ddc0..c1e6b02 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,4 +1,5 @@ #!/bin/bash + set -e VERSION=$1 @@ -9,23 +10,26 @@ if [ -z "$VERSION" ]; then fi echo "🔨 Building $VERSION..." +# Remove old build files but keep .git +rm -rf dist/assets dist/index.html dist/*.js dist/*.css dist/vite.svg + bun run build echo "📄 Adding README..." -cp public/README.md dist/README.md +if [ -f public/README.md ]; then + cp public/README.md dist/README.md +fi echo "📦 Deploying to GitHub Pages..." cd dist + git add . git commit -m "Deploy $VERSION" || echo "No changes to commit" git push cd .. + echo "✅ Deployed to https://kccleoc.github.io/seedpgp-web-app/" -echo "📖 Repo: https://github.com/kccleoc/seedpgp-web-app" -echo "🏷️ Don't forget to tag: git tag $VERSION && git push --tags" -echo "./scripts/deploy.sh v1.2.0" -echo "git tag v1.2.0" -echo "git push --tags" - - +echo "" +echo "Tag private repo:" +echo " git tag $VERSION && git push origin --tags" diff --git a/vite.config.ts b/vite.config.ts index 75a9638..28166f0 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,16 +3,9 @@ import react from '@vitejs/plugin-react' export default defineConfig({ plugins: [react()], - base: '/seedpgp-web-app/', // Match your repo name + base: '/seedpgp-web-app/', build: { - chunkSizeWarningLimit: 600, // Suppress warning - rollupOptions: { - output: { - manualChunks: { - 'openpgp': ['openpgp'], // Separate chunk for PGP - } - } - } + outDir: 'dist', + emptyOutDir: false, } }) -