diff --git a/index.html b/index.html index 7242f309..ec7f4e39 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@ - + diff --git a/scripts/preview-config.js b/scripts/preview-config.js index 75746f98..26f55b06 100644 --- a/scripts/preview-config.js +++ b/scripts/preview-config.js @@ -1,5 +1,6 @@ // Preview builds: set the background scene tier in dist/config.json (default 'low'); config.json -// in the repo stays 'off'. Usage: node scripts/preview-config.js [tier] [style] +// in the repo stays 'off'. Previews are static directories with no SPA fallback, so they also switch +// to the hash router: a reload on /login/matrix.org would otherwise be an nginx 404. Usage: node scripts/preview-config.js [tier] [style] import fs from 'fs'; import path from 'path'; import { fileURLToPath } from 'url'; @@ -8,6 +9,7 @@ const tier = process.argv[2] ?? 'low'; const style = process.argv[3]; const file = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'dist', 'config.json'); const config = JSON.parse(fs.readFileSync(file, 'utf8')); +config.hashRouter = { enabled: true, basename: '/' }; config.backgroundScene = { ...config.backgroundScene, tier, ...(style ? { style } : {}) }; fs.writeFileSync(file, `${JSON.stringify(config, null, 2)}\n`); console.log(`${file}: backgroundScene.tier = ${tier}${style ? `, style = ${style}` : ''}`);