Resolves #5756
MicroLoader.mjs now imports the app-local neo-config.json as a JSON module using import attributes, while preserving the previous document-relative lookup semantics via document.baseURI before bootstrapping mainPath.
The production appworker build now minifies the copied src/MicroLoader.mjs with Terser instead of deleting all whitespace. The old production copy step transformed new URL(...) into newURL(...), which broke dist/production at runtime.
Evidence: L3 (post-rebase build-all, local browser portal matrix, and focused whitebox e2e) -> L3 required (MicroLoader browser bootstrap and generated dist portal output). Residual: GitHub CI on pushed head.
Deltas from ticket
- Preserved the old
fetch('./neo-config.json') document-relative behavior by resolving the dynamic import specifier with new URL('./neo-config.json', document.baseURI).href.
- Updated bootstrap docs that explicitly described the retired fetch/json parse path.
- Replaced production MicroLoader whitespace stripping with Terser module minification so generated
dist/production/src/MicroLoader.mjs preserves valid JavaScript syntax.
Test Evidence
git diff --check
node --check src/MicroLoader.mjs
node --check buildScripts/webpack/production/webpack.config.appworker.mjs
npm run build-all -- -l no (post-rebase, passed; total time 31.49s)
- Browser smoke against local exact-head server:
/apps/portal/, /apps/portal/index.html, /dist/development/apps/portal/, /dist/esm/apps/portal/, and /dist/production/apps/portal/ all rendered .neo-viewport with expected Neo.config.environment / mainPath values.
npm run test-e2e -- test/playwright/e2e/NeuralLink.spec.mjs (post-rebase, 1 passed)
npm run test-e2e -- test/playwright/e2e/LivePreviewMultiWindow.spec.mjs (post-rebase, 12 passed)
Post-Merge Validation
Commits
df3c4d354a — feat(core): import MicroLoader config as JSON module (#5756)
590dfd7f6a — fix(build): preserve production MicroLoader syntax (#5756)
Authored by Euclid (GPT-5, Codex Desktop). Session db5b2ecf-db91-4b7d-9498-ccef00426a1c.
Author response
The evidence request found a real blocker: generated dist/production/src/MicroLoader.mjs was invalid because the production appworker build deleted all whitespace, turning new URL(...) into newURL(...).
Fix pushed in 590dfd7f6a: production MicroLoader generation now uses Terser module minification instead of raw whitespace stripping.
Post-rebase evidence is now in the PR body. Highlights:
npm run build-all -- -l no passed.
- Five portal entry URLs passed a local browser smoke, including
dist/production.
test/playwright/e2e/NeuralLink.spec.mjs passed.
test/playwright/e2e/LivePreviewMultiWindow.spec.mjs passed 12/12 across dev, dist/development, and dist/production.
CI is running on the rebased head 590dfd7f6aac06404b7cd1c4f6d0f128e7369642.
Resolves #5756
MicroLoader.mjsnow imports the app-localneo-config.jsonas a JSON module using import attributes, while preserving the previous document-relative lookup semantics viadocument.baseURIbefore bootstrappingmainPath.The production appworker build now minifies the copied
src/MicroLoader.mjswith Terser instead of deleting all whitespace. The old production copy step transformednew URL(...)intonewURL(...), which brokedist/productionat runtime.Evidence: L3 (post-rebase build-all, local browser portal matrix, and focused whitebox e2e) -> L3 required (MicroLoader browser bootstrap and generated dist portal output). Residual: GitHub CI on pushed head.
Deltas from ticket
fetch('./neo-config.json')document-relative behavior by resolving the dynamic import specifier withnew URL('./neo-config.json', document.baseURI).href.dist/production/src/MicroLoader.mjspreserves valid JavaScript syntax.Test Evidence
git diff --checknode --check src/MicroLoader.mjsnode --check buildScripts/webpack/production/webpack.config.appworker.mjsnpm run build-all -- -l no(post-rebase, passed; total time 31.49s)/apps/portal/,/apps/portal/index.html,/dist/development/apps/portal/,/dist/esm/apps/portal/, and/dist/production/apps/portal/all rendered.neo-viewportwith expectedNeo.config.environment/mainPathvalues.npm run test-e2e -- test/playwright/e2e/NeuralLink.spec.mjs(post-rebase, 1 passed)npm run test-e2e -- test/playwright/e2e/LivePreviewMultiWindow.spec.mjs(post-rebase, 12 passed)Post-Merge Validation
Commits
df3c4d354a—feat(core): import MicroLoader config as JSON module (#5756)590dfd7f6a—fix(build): preserve production MicroLoader syntax (#5756)Authored by Euclid (GPT-5, Codex Desktop). Session db5b2ecf-db91-4b7d-9498-ccef00426a1c.
Author response
The evidence request found a real blocker: generated
dist/production/src/MicroLoader.mjswas invalid because the production appworker build deleted all whitespace, turningnew URL(...)intonewURL(...).Fix pushed in
590dfd7f6a: production MicroLoader generation now uses Terser module minification instead of raw whitespace stripping.Post-rebase evidence is now in the PR body. Highlights:
npm run build-all -- -l nopassed.dist/production.test/playwright/e2e/NeuralLink.spec.mjspassed.test/playwright/e2e/LivePreviewMultiWindow.spec.mjspassed 12/12 across dev, dist/development, and dist/production.CI is running on the rebased head
590dfd7f6aac06404b7cd1c4f6d0f128e7369642.