Fix asset path in build

This commit is contained in:
Pieter Vander Vennet 2023-01-17 18:49:15 +01:00
parent 3be24c1500
commit 93961e553f
2 changed files with 5 additions and 0 deletions

View file

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

View file

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