| 197 | |
| 198 | /** @type {(options: Partial<TaskOptions> & {platforms: TaskOptions['platforms']}, entries?: JSEntry[]) => Promise<void>} */ |
| 199 | const bundleEachPlatform = async ({platforms, debug, watch, log, test}, entries) => { |
| 200 | const allPlatforms = Object.values(PLATFORM).filter((platform) => platform !== PLATFORM.API); |
| 201 | for (const entry of (entries || jsEntries)) { |
| 202 | const possiblePlatforms = entry.platform ? [entry.platform] : allPlatforms; |
| 203 | const targetPlatforms = possiblePlatforms.filter((platform) => platforms[platform]); |
| 204 | for (const platform of targetPlatforms) { |
| 205 | await bundleJS(entry, platform, debug, watch, log, test); |
| 206 | } |
| 207 | } |
| 208 | }; |
| 209 | |
| 210 | /** @type {(changedFiles: string[], watcher: FSWatcher, platforms: any) => Promise<void>} */ |
| 211 | const onChange = async (changedFiles, watcher, initialPlatforms) => { |