(_, rollupBundle)
| 494 | generateBundle: { |
| 495 | order: 'post', |
| 496 | async handler(_, rollupBundle) { |
| 497 | const opts = qwikPlugin.getOptions(); |
| 498 | |
| 499 | if (opts.target === 'client') { |
| 500 | // client build |
| 501 | |
| 502 | for (const [fileName, b] of Object.entries(rollupBundle)) { |
| 503 | if (b.type === 'asset') { |
| 504 | const baseFilename = basePathname + fileName; |
| 505 | if (STYLING.some((ext) => fileName.endsWith(ext))) { |
| 506 | if (typeof b.source === 'string' && b.source.length < opts.inlineStylesUpToBytes) { |
| 507 | injections.push({ |
| 508 | tag: 'style', |
| 509 | location: 'head', |
| 510 | attributes: { |
| 511 | 'data-src': baseFilename, |
| 512 | dangerouslySetInnerHTML: b.source, |
| 513 | }, |
| 514 | }); |
| 515 | } else { |
| 516 | injections.push({ |
| 517 | tag: 'link', |
| 518 | location: 'head', |
| 519 | attributes: { |
| 520 | rel: 'stylesheet', |
| 521 | href: baseFilename, |
| 522 | }, |
| 523 | }); |
| 524 | } |
| 525 | } else { |
| 526 | const selectedFont = FONTS.find((ext) => fileName.endsWith(ext)); |
| 527 | if (selectedFont && !disableFontPreload) { |
| 528 | injections.unshift({ |
| 529 | tag: 'link', |
| 530 | location: 'head', |
| 531 | attributes: { |
| 532 | rel: 'preload', |
| 533 | href: baseFilename, |
| 534 | as: 'font', |
| 535 | type: `font/${selectedFont.slice(1)}`, |
| 536 | crossorigin: '', |
| 537 | }, |
| 538 | }); |
| 539 | } |
| 540 | } |
| 541 | } |
| 542 | } |
| 543 | |
| 544 | const clientManifestStr = await qwikPlugin.generateManifest( |
| 545 | this, |
| 546 | rollupBundle, |
| 547 | bundleGraphAdders, |
| 548 | { |
| 549 | injections, |
| 550 | platform: { vite: '' }, |
| 551 | } |
| 552 | ); |
| 553 |
no test coverage detected
searching dependent graphs…