diff --git a/build.sh b/build.sh index ef925ec..691c22f 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,17 @@ #!/bin/bash + cd "$(dirname "$0")" + +PREFIX="threefoldgalaxy" + +# echo "Building without prefix" +# export VITE_APP_BASE_URL="" +# pnpm run build +# rsync -avz --delete dist/ "root@threefold.info:/root/hero/www/info/$PREFIX/" + +echo "Building with prefix: /$PREFIX/" +export VITE_APP_BASE_URL="/$PREFIX/" pnpm run build -rsync -avz --delete dist/ root@threefold.info:/root/hero/www/info/threefoldgalaxy/ -rsync -rav --delete dist/ ${HOME}/hero/var/www/threefoldgalaxy/ \ No newline at end of file +rsync -rav --delete dist/ "${HOME}/hero/var/www/$PREFIX/" +rsync -avz --delete dist/ "root@threefold.info:/root/hero/www/info/$PREFIX/" + diff --git a/vite.config.js b/vite.config.js index 3a61a89..8b847c2 100644 --- a/vite.config.js +++ b/vite.config.js @@ -5,9 +5,12 @@ import path from 'path' // https://vite.dev/config/ export default defineConfig({ - plugins: [react(),tailwindcss()], + base: process.env.VITE_APP_BASE_URL || '/', + plugins: [react(), tailwindcss({ + config: './tailwind.config.js', + })], server: { - allowedHosts: ['*','6162370c7e84.ngrok-free.app','092443e84c95.ngrok-free.app'], + allowedHosts: ['919d3b60e744.ngrok-free.app'], }, resolve: { alias: {