Skip to content

Commit 730cb46

Browse files
lifeartclaude
andcommitted
fix(ci): drop preserveModules from GXT-mode build for testem compat
`preserveModules: true` produced ~1000 per-source chunks in the GXT-mode build output. testem-based Basic Test loads the static dist/ via Chrome and waits for `testem.js` to be reachable from the page; with that many script tags the cold-cache page load blew past the 120s `browser_start_timeout`, producing "Browser failed to connect within 120s. testem.js not loaded?" with zero tests run. The setting was added to support the GXT smoke harness. That harness runs against Vite's dev server (`pnpm vite --port 5180`), not a built dist, so the rollup build config is irrelevant to it. Dropping the special case yields a single bundled chunk (~7.5MB / ~1.4MB gzipped) that testem can load fast. Smoke harness path is unchanged. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
1 parent 392eeec commit 730cb46

1 file changed

Lines changed: 12 additions & 18 deletions

File tree

vite.config.mjs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -34,24 +34,18 @@ export default defineConfig(({ mode }) => {
3434
// Use GXT_MODE=true to enable glimmer-next integration
3535
const useGxt = process.env.GXT_MODE === 'true';
3636

37-
// preserveModules + preserveEntrySignatures are required for the GXT test
38-
// harness so test files can be served as independent modules; under the
39-
// classic build those settings break vite's modulepreload-polyfill, so
40-
// apply them only in GXT mode.
41-
const build = useGxt
42-
? {
43-
rollupOptions: {
44-
preserveEntrySignatures: 'strict',
45-
input: ['index.html'],
46-
output: {
47-
preserveModules: true,
48-
},
49-
},
50-
minify: mode === 'production',
51-
}
52-
: {
53-
minify: mode === 'production',
54-
};
37+
// preserveModules + preserveEntrySignatures previously emitted per-source
38+
// chunks for the GXT smoke runner. That harness uses Vite's dev server
39+
// (`pnpm vite --port 5180`) which serves modules natively, so the build-time
40+
// preserveModules setting was no longer load-bearing — but it WAS load-
41+
// breaking for the testem-based Basic Test job, which loads the static
42+
// dist/ output: ~1000 script tags blew past testem's 120s
43+
// `browser_start_timeout` waiting for them all to fetch+parse before
44+
// testem.js could connect. Drop the special case so all builds emit a
45+
// bundled output suitable for testem.
46+
const build = {
47+
minify: mode === 'production',
48+
};
5549

5650
return {
5751
plugins: [

0 commit comments

Comments
 (0)