Skip to content

Commit c8e8e6b

Browse files
authored
Merge pull request #7850 from maiieul/disable-rollup-transitive-imports-by-default
fix: hoisted transitive imports mess up the bundle-graph static imports graph
2 parents 0ab5665 + 953d84d commit c8e8e6b

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

.changeset/hot-buses-strive.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@builder.io/qwik': patch
3+
---
4+
5+
FIX: Rollup's hoistTranstiveImports is now set to `false` because the hoisting added unnecessary bundles to be preloaded to the bundle-graph static imports graph. This could lead to a suboptimal preloading experience.

packages/qwik/src/optimizer/src/plugins/rollup.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ export function normalizeRollupOutputOptionsObject(
243243
outputOpts.exports = 'auto';
244244
}
245245

246+
/**
247+
* Transitive imports must not be hoisted. Otherwise, the bundle-graph static imports will be
248+
* incorrect; leading to over-preloading.
249+
*/
250+
outputOpts.hoistTransitiveImports = false;
251+
246252
return outputOpts;
247253
}
248254

packages/qwik/src/optimizer/src/plugins/vite.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,6 @@ export function qwikVite(qwikViteOpts: QwikVitePluginOptions = {}): any {
323323
* https://github.com/QwikDev/qwik/issues/7226#issuecomment-2647122505
324324
*/
325325
maxParallelFileOps: 1,
326-
output: {
327-
manualChunks: qwikPlugin.manualChunks,
328-
},
329326
// temporary fix for rolldown-vite types
330327
} as BuildOptions['rollupOptions'],
331328
},

0 commit comments

Comments
 (0)