(changedFiles, watcher, platforms)
| 103 | |
| 104 | /** @type {(changedFiles: string[], watcher: FSWatcher, platforms: any) => Promise<void>} */ |
| 105 | const onChange = async (changedFiles, watcher, platforms) => { |
| 106 | const entries = cssEntries.filter((entry) => { |
| 107 | const entryFile = getEntryFile(entry); |
| 108 | return changedFiles.some((changed) => { |
| 109 | return entry.watchFiles?.includes(changed) || changed === entryFile; |
| 110 | }); |
| 111 | }); |
| 112 | for (const entry of entries) { |
| 113 | const css = await bundleCSSEntry(entry, true); |
| 114 | await writeFiles(entry.dest, platforms, true, css); |
| 115 | } |
| 116 | |
| 117 | const newWatchFiles = getWatchFiles(); |
| 118 | watcher.unwatch( |
| 119 | currentWatchFiles.filter((oldFile) => !newWatchFiles.includes(oldFile)) |
| 120 | ); |
| 121 | watcher.add( |
| 122 | newWatchFiles.filter((newFile) => currentWatchFiles.includes(newFile)) |
| 123 | ); |
| 124 | |
| 125 | reload.reload({type: reload.CSS}); |
| 126 | }; |
| 127 | |
| 128 | return createTask( |
| 129 | 'bundle-css', |
nothing calls this directly
no test coverage detected