Skip to content

Commit 6896133

Browse files
maiieulwmertens
authored andcommitted
refactor: opts.entryStrategy.manual check in manualChunks
1 parent 0c027bb commit 6896133

File tree

1 file changed

+8
-11
lines changed
  • packages/qwik/src/optimizer/src/plugins

1 file changed

+8
-11
lines changed

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

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -893,17 +893,14 @@ export const manifest = ${JSON.stringify(manifest)};\n`;
893893
if (id.endsWith(QWIK_PRELOADER_REAL_ID)) {
894894
return 'qwik-preloader';
895895
}
896-
// TODO when manual chunks fix lands in rollup, remove this guard
897-
if ((opts.entryStrategy as SmartEntryStrategy).manual) {
898-
const module = getModuleInfo(id)!;
899-
const segment = module.meta.segment as SegmentAnalysis | undefined;
900-
901-
if (segment) {
902-
const { hash } = segment;
903-
const chunkName = (opts.entryStrategy as SmartEntryStrategy).manual![hash] || segment.entry;
904-
if (chunkName) {
905-
return chunkName;
906-
}
896+
897+
const module = getModuleInfo(id)!;
898+
const segment = module.meta.segment as SegmentAnalysis | undefined;
899+
if (segment) {
900+
const { hash } = segment;
901+
const chunkName = (opts.entryStrategy as SmartEntryStrategy).manual?.[hash] || segment.entry;
902+
if (chunkName) {
903+
return chunkName;
907904
}
908905
}
909906
return null;

0 commit comments

Comments
 (0)