diff --git a/scripts/build.sh b/scripts/build.sh index 94f79f31f..35780073c 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -33,6 +33,9 @@ then echo "Source maps are enabled" fi +ASSET_URL="mc/$BRANCH" +export ASSET_URL +echo "$ASSET_URL" export NODE_OPTIONS=--max-old-space-size=6500 vite build $SRC_MAPS diff --git a/vite.config.js b/vite.config.js index f7d60534a..16ab03236 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2,6 +2,7 @@ const { defineConfig } = require("vite") import fs from "fs" const allHtmlFiles = fs.readdirSync(".").filter((f) => f.endsWith(".html")) const input = {} +const ASSET_URL = process.env.ASSET_URL || "" for (const html of allHtmlFiles) { const name = html.substring(0, html.length - 5) @@ -14,6 +15,7 @@ module.exports = defineConfig({ input, }, }, + base: `${ASSET_URL}`, server: { port: 1234, },