From 9792bc9162f77557a0dddce1402434f316f75949 Mon Sep 17 00:00:00 2001 From: doxa-maps-88655c70 <88627970+doxa-maps-88655c70@users.noreply.github.com> Date: Fri, 25 Sep 2026 15:52:20 +0000 Subject: [PATCH] Gallery: its dev manifest fallback names the tree from the build config, not a literal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The one tree path compiled into any bundle. Built today it is byte-identical (sha 3d5467fd…); built with the config renamed it reads /public//manifest.json. --- plugin-designs/doxa-maps-spa/doxa-maps-spa.vue | 4 +++- vite.config.js | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/plugin-designs/doxa-maps-spa/doxa-maps-spa.vue b/plugin-designs/doxa-maps-spa/doxa-maps-spa.vue index 690900356..16fd3b5c3 100644 --- a/plugin-designs/doxa-maps-spa/doxa-maps-spa.vue +++ b/plugin-designs/doxa-maps-spa/doxa-maps-spa.vue @@ -1132,7 +1132,9 @@ export default defineComponent({ let crossOrigin = false try { crossOrigin = new URL(rootUrl, location.href).origin !== location.origin } catch { /* relative = same */ } const candidates = crossOrigin ? [copy, root] : [root, copy] - const devFallback = '/public/doxa-maps/manifest.json' + // The tree's name comes from the build config (vite define), never a literal here: this was the + // one tree path compiled into any bundle, so a renamed tree would have needed a gallery edit. + const devFallback = '/public/' + __DOXA_TREE_NAME__ + '/manifest.json' if (!candidates.some(c => c.url === devFallback)) candidates.push({ url: devFallback, root: dirOf(devFallback) }) const tried = [] const attempt = (i) => { diff --git a/vite.config.js b/vite.config.js index 9a0e184d3..c2fd4e354 100644 --- a/vite.config.js +++ b/vite.config.js @@ -99,7 +99,12 @@ export default defineConfig(({ command, mode }) => { // the maintainer's internal platform and must NOT exist in public // artifacts. Default FALSE strips it from every bundle (dead-branch + // treeshake); an explicitly-flagged platform build sets DOXA_QA=1. - define: { __DOXA_QA__: JSON.stringify(process.env.DOXA_QA === '1') }, + define: { + __DOXA_QA__: JSON.stringify(process.env.DOXA_QA === '1'), + // The output tree's name (vite.doxa-maps-build-config.json `name`, the same value OUT_ROOT uses), + // for the few runtime paths that must name the tree — so renaming the tree needs no source edit. + __DOXA_TREE_NAME__: JSON.stringify(MFE_NAME), + }, // Build only: shadow-DOM CSS is injected from useShadowStyles(`…`) literals that // ship verbatim, so their block comments are stripped before the Vue compiler // runs (enforce: 'pre'). Dev keeps the comments.