chore: configure vite for GitHub Pages deployment

This commit is contained in:
LC mac
2026-01-29 00:21:26 +08:00
parent c55390228b
commit b7da81c5d4
2 changed files with 15 additions and 18 deletions

View File

@@ -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"

View File

@@ -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,
}
})