({platforms, debug})
| 98 | */ |
| 99 | export function createBundleHTMLTask(htmlEntries) { |
| 100 | const bundleHTML = async ({platforms, debug}) => { |
| 101 | const promises = []; |
| 102 | const enabledPlatforms = Object.values(PLATFORM).filter((platform) => platform !== PLATFORM.API && platforms[platform]); |
| 103 | for (const entry of htmlEntries) { |
| 104 | if (entry.platforms && !entry.platforms.some((platform) => platforms[platform])) { |
| 105 | continue; |
| 106 | } |
| 107 | for (const platform of enabledPlatforms) { |
| 108 | if (entry.platforms === undefined || entry.platforms.includes(platform)) { |
| 109 | promises.push(writeEntry(entry, {debug, platform})); |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | await Promise.all(promises); |
| 114 | }; |
| 115 | |
| 116 | return createTask( |
| 117 | 'bundle-html', |
nothing calls this directly
no test coverage detected