mirror of
https://github.com/kccleoc/seedpgp-web.git
synced 2026-03-07 09:57:50 +08:00
chore: configure vite for GitHub Pages deployment
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
VERSION=$1
|
VERSION=$1
|
||||||
@@ -9,23 +10,26 @@ if [ -z "$VERSION" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "🔨 Building $VERSION..."
|
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
|
bun run build
|
||||||
|
|
||||||
echo "📄 Adding README..."
|
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..."
|
echo "📦 Deploying to GitHub Pages..."
|
||||||
cd dist
|
cd dist
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
git commit -m "Deploy $VERSION" || echo "No changes to commit"
|
git commit -m "Deploy $VERSION" || echo "No changes to commit"
|
||||||
git push
|
git push
|
||||||
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
echo "✅ Deployed to https://kccleoc.github.io/seedpgp-web-app/"
|
echo "✅ Deployed to https://kccleoc.github.io/seedpgp-web-app/"
|
||||||
echo "📖 Repo: https://github.com/kccleoc/seedpgp-web-app"
|
echo ""
|
||||||
echo "🏷️ Don't forget to tag: git tag $VERSION && git push --tags"
|
echo "Tag private repo:"
|
||||||
echo "./scripts/deploy.sh v1.2.0"
|
echo " git tag $VERSION && git push origin --tags"
|
||||||
echo "git tag v1.2.0"
|
|
||||||
echo "git push --tags"
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,16 +3,9 @@ import react from '@vitejs/plugin-react'
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
base: '/seedpgp-web-app/', // Match your repo name
|
base: '/seedpgp-web-app/',
|
||||||
build: {
|
build: {
|
||||||
chunkSizeWarningLimit: 600, // Suppress warning
|
outDir: 'dist',
|
||||||
rollupOptions: {
|
emptyOutDir: false,
|
||||||
output: {
|
|
||||||
manualChunks: {
|
|
||||||
'openpgp': ['openpgp'], // Separate chunk for PGP
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user