(
chunk: OutputChunk,
seen: Set<string> = new Set(),
)
| 825 | const analyzedImportedCssFiles = new Map<OutputChunk, string[]>() |
| 826 | const inlineEntryChunk = new Set<string>() |
| 827 | const getImportedChunks = ( |
| 828 | chunk: OutputChunk, |
| 829 | seen: Set<string> = new Set(), |
| 830 | ): (OutputChunk | string)[] => { |
| 831 | const chunks: (OutputChunk | string)[] = [] |
| 832 | chunk.imports.forEach((file) => { |
| 833 | const importee = bundle[file] |
| 834 | if (importee) { |
| 835 | if (importee.type === 'chunk' && !seen.has(file)) { |
| 836 | seen.add(file) |
| 837 | |
| 838 | // post-order traversal |
| 839 | chunks.push(...getImportedChunks(importee, seen)) |
| 840 | chunks.push(importee) |
| 841 | } |
| 842 | } else { |
| 843 | // external imports |
| 844 | chunks.push(file) |
| 845 | } |
| 846 | }) |
| 847 | return chunks |
| 848 | } |
| 849 | |
| 850 | const toScriptTag = ( |
| 851 | chunkOrUrl: OutputChunk | string, |
no test coverage detected