MCPcopy Index your code
hub / github.com/darkreader/darkreader / createBundleHTMLTask

Function createBundleHTMLTask

tasks/bundle-html.js:99–120  ·  view source on GitHub ↗
(htmlEntries)

Source from the content-addressed store, hash-verified

97 * @returns {ReturnType<typeof createTask>}
98 */
99export 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',
118 bundleHTML,
119 );
120}
121
122export default createBundleHTMLTask(htmlEntries);

Callers 1

bundle-html.jsFile · 0.85

Calls 1

createTaskFunction · 0.90

Tested by

no test coverage detected