This repository was archived by the owner on Sep 1, 2026. It is now read-only.
Addressing #1346 from dependabot - updating vite version - #1534
Merged
Conversation
Vite 8 replaces esbuild/Rollup with Oxc/Rolldown. The esbuild minifyIdentifiers and
keepNames options are no longer honoured, so the built template lost the
reportData={ ... EndOfJson:"EndOfJson"} markers that Get-HtmlReport splices the
assessment JSON into, and the classic build additionally failed to type check.
Nothing in CI rebuilds the template, so this would only have surfaced at runtime as
"Report template markers were not found in template".
The placeholder is now emitted verbatim into the HTML by a transformIndexHtml plugin,
which keeps it away from the JS minifier entirely. The demo dataset moves to a single
shared demo-report-data.json instead of being duplicated in both report source trees,
and still gets replaced wholesale by Get-HtmlReport. The marker strings are unchanged,
so no PowerShell changes were required.
Adds a Pester test covering both templates: marker counts, marker ordering, the
single-file invariant, and a Get-HtmlReport round trip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #1346 (Dependabot: Vite 7.3.2 → 8.x in
/src/report). Please close that PR in favour of this one.#1346cannot be merged as-is: the Vite 8 upgrade silently breaks report generation, and nothing in CI would have caught it.What breaks under Vite 8
Vite 8 replaces esbuild/Rollup with Oxc/Rolldown. The report configs relied on
esbuild: { minifyIdentifiers: false, keepNames: true }to preserve the placeholder thatGet-HtmlReportsplices the assessment JSON into. Vite 8 does not map those options to Oxc and says so at build time:Result, reproduced locally on top of
dev:reportDatamangled away — 0 occurrencesesbuildoption no longer assignable toESBuildOptionsEndOfJson:"EndOfJson"}EndOfJson:`EndOfJson`— Oxc rewrites quotes to backticksTwo independent breakages. At runtime
Invoke-ZtAssessmentwould have thrownReport template markers were not found in template.A config-only fix is not possible: Rolldown's
CodegenOptionsexposes onlyremoveWhitespaceandlegalComments, so there is no way to force double quotes.The fix
The placeholder is now injected verbatim into the HTML by a small
transformIndexHtmlplugin (src/report/vite-plugin-report-data.ts), which keeps it out of the JS bundle and away from the minifier entirely — immune to identifier mangling and quote-style changes, now and on future bundler swaps.The demo dataset moves to a single shared
src/report/demo-report-data.json(it was duplicated verbatim across both source trees) and is still emitted inside the marker span, soGet-HtmlReportreplaces it wholesale exactly as before.The marker strings are unchanged, so no PowerShell changes were required.
Also in scope, all required to get the build green:
vite.config.ts/vite.config.current.ts: drop the now-ignoredesbuildblock;rollupOptions→rolldownOptionstsconfig.node.json: include the new plugin and the current configVerification
<script src=/<link stylesheet>refs (single-file invariant holds)SampleReport.jsonthrough the realGet-HtmlReport: both templates OK, 295 tests,TenantName: Contoso, all pillar routes render, charts render, zero console errors, reports −26%npm run devverifiedNew-DemoReport.ps1anonymization check passes with no leaksNew regression test
code-tests/commands/ReportTemplate.Markers.Tests.ps1asserts, for both templates: marker counts, marker ordering, the single-file invariant, and aGet-HtmlReportround trip. It runs inside the existingvalidate.ymlPester job — no new CI infrastructure.Confirmed to have teeth: against a deliberately Oxc-mangled template it produces 4 failures, including the real
Get-HtmlReportthrow. This closes the gap that made the whole exercise necessary — CI green previously said nothing about the report.Notes for reviewers
@babel/core7.28.5 → 7.29.7).@vitejs/plugin-react6 uses Oxc instead of Babel, so@babel/coreis gone from the tree entirely — 22@babel/*packages down to 1, 547 → 490 packages total, npm audit 10 → 5.brace-expansion, root lockfile) is unrelated and does not conflict.devrather thanmain, since that is where the current report sources live.ReportTemplate.classic.htmlondevwas already stale — a clean rebuild was 11 KB smaller than the committed file.SampleReport.htmlat the repo root still embeds the previous template, and the Vite native-config-loader warnings (__dirname, extensionless import) remain.