build: the QA fixture sources stay out of production builds

The ?qaFeed import is now gated by import.meta.env.DEV at its import site,
so Rollup drops the qaSources chunk (4.7 KB) from production builds instead
of shipping it unreachable. Dev behaviour is unchanged. (T8-T9 review item 3)
This commit is contained in:
German Khokhlov committed 2026-10-16 23:18:33 +04:00
1 parent bf46eb6d97
commit c493a8303b
1 file changed
+5 -1
+5 -1
View File
@@ -68,8 +68,12 @@ export function createStandaloneApplication({
// kept for links.
// QA fixture sources (?qaFeed=…) on the dev server only.
const search = globalThis.location?.search ?? '';
// import.meta.env.DEV at the import site, so production builds drop
// the chunk instead of shipping it unreachable.
const qaSources =
allowQaRegistration && /[?&]qaFeed=/.test(search)
import.meta.env?.DEV &&
allowQaRegistration &&
/[?&]qaFeed=/.test(search)
? await import('../app/layers/qaSources.js').then(
({ createQaSources, parseQaFeed }) =>
createQaSources(parseQaFeed(search)),