Skip to content

Commit 99dd625

Browse files
committed
chore: use regexes
1 parent 3eb278f commit 99dd625

File tree

1 file changed

+2
-5
lines changed
  • packages/qwik/src/optimizer/src/plugins

1 file changed

+2
-5
lines changed

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -885,13 +885,10 @@ export const manifest = ${JSON.stringify(manifest)};\n`;
885885
// To prevent over-prefetching, we need to clearly seperate those chunks,
886886
// otherwise rollup can bundle them together with the first component chunk it finds.
887887
// For example, the core code could go into an Accordion.tsx chunk, which would make the whole app import accordion related chunks everywhere.
888-
if (id.endsWith('qwik/dist/core.prod.mjs') || id.endsWith('qwik/dist/core.prod.cjs')) {
888+
if (/\/(qwik|core)\/dist\/core.*js$/.test(id)) {
889889
return 'core';
890890
}
891-
if (
892-
id.endsWith('qwik-city/lib/index.qwik.mjs') ||
893-
id.endsWith('qwik-city/lib/index.qwik.cjs')
894-
) {
891+
if (/\/(qwik-city|router)\/lib\/index.qwik.*js$/.test(id)) {
895892
return 'qwik-city';
896893
}
897894
if (id.endsWith('vite/preload-helper.js')) {

0 commit comments

Comments
 (0)