( src: string, projectDir: string, doc: Document, seenSrcs: Set<string>, chunks: string[], )
| 633 | } |
| 634 | |
| 635 | function hoistExternalScript( |
| 636 | src: string, |
| 637 | projectDir: string, |
| 638 | doc: Document, |
| 639 | seenSrcs: Set<string>, |
| 640 | chunks: string[], |
| 641 | ): void { |
| 642 | if (seenSrcs.has(src)) return; |
| 643 | seenSrcs.add(src); |
| 644 | if (!isNonRelativeUrl(src) && !isAbsolute(src)) { |
| 645 | const jsPath = resolveWithinProject(projectDir, src); |
| 646 | const js = jsPath ? safeReadFile(jsPath) : null; |
| 647 | if (js != null) { |
| 648 | chunks.push(js); |
| 649 | return; |
| 650 | } |
| 651 | } |
| 652 | ensureExternalScriptTag(doc, src); |
| 653 | } |
| 654 | |
| 655 | function hoistCompositionScripts( |
| 656 | container: { querySelectorAll: (sel: string) => NodeListOf<Element> }, |
no test coverage detected