Skip to content

Commit 4a33b4c

Browse files
committed
fix(manifest): detect special bundles correctly
1 parent 6783157 commit 4a33b4c

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

packages/qwik/src/optimizer/src/manifest.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,13 +475,16 @@ export function generateManifestFromBundles(
475475
.map((m) => path.relative(opts.rootDir, m));
476476
if (modulePaths.length > 0) {
477477
bundle.origins = modulePaths;
478+
// keep these if statements separate so that weird bundling still works
478479
if (modulePaths.some((m) => /[/\\](core|qwik)[/\\]dist[/\\]preloader\.[cm]js$/.test(m))) {
479480
manifest.preloader = bundleFileName;
480-
} else if (
481+
}
482+
if (
481483
modulePaths.some((m) => /[/\\](core|qwik)[/\\]dist[/\\]core(.min|.prod)?\.[cm]js$/.test(m))
482484
) {
483485
manifest.core = bundleFileName;
484-
} else if (modulePaths.some((m) => /[/\\](core|qwik)[/\\]handlers\.[cm]js$/.test(m))) {
486+
}
487+
if (modulePaths.some((m) => /[/\\](core|qwik)[/\\]handlers\.[cm]js$/.test(m))) {
485488
qwikHandlersName = bundleFileName;
486489
}
487490
}
@@ -527,7 +530,7 @@ export function generateManifestFromBundles(
527530
manifest.mapping[symbol] = qwikHandlersName;
528531
}
529532
} else {
530-
console.error('Qwik bundle not found, is Qwik actually used in this project?');
533+
console.error('Qwik core bundle not found, is Qwik actually used in this project?');
531534
}
532535

533536
for (const bundle of Object.values(manifest.bundles)) {

0 commit comments

Comments
 (0)