mirror of
https://github.com/kccleoc/seedpgp-web.git
synced 2026-03-07 01:47:52 +08:00
chore: configure vite for GitHub Pages deployment
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user