mirror of
https://github.com/xoseperez/espurna.git
synced 2026-03-06 08:24:27 +01:00
webui(build): gulp html modifications should not happen in parallel
Promise.all() does not handle array members in sequence
This commit is contained in:
4997
code/espurna/static/index.all.html.ipp
generated
4997
code/espurna/static/index.all.html.ipp
generated
File diff suppressed because it is too large
Load Diff
3076
code/espurna/static/index.curtain.html.ipp
generated
3076
code/espurna/static/index.curtain.html.ipp
generated
File diff suppressed because it is too large
Load Diff
3012
code/espurna/static/index.garland.html.ipp
generated
3012
code/espurna/static/index.garland.html.ipp
generated
File diff suppressed because it is too large
Load Diff
4254
code/espurna/static/index.light.html.ipp
generated
4254
code/espurna/static/index.light.html.ipp
generated
File diff suppressed because it is too large
Load Diff
3015
code/espurna/static/index.lightfox.html.ipp
generated
3015
code/espurna/static/index.lightfox.html.ipp
generated
File diff suppressed because it is too large
Load Diff
3087
code/espurna/static/index.rfbridge.html.ipp
generated
3087
code/espurna/static/index.rfbridge.html.ipp
generated
File diff suppressed because it is too large
Load Diff
3087
code/espurna/static/index.rfm69.html.ipp
generated
3087
code/espurna/static/index.rfm69.html.ipp
generated
File diff suppressed because it is too large
Load Diff
3295
code/espurna/static/index.sensor.html.ipp
generated
3295
code/espurna/static/index.sensor.html.ipp
generated
File diff suppressed because it is too large
Load Diff
2986
code/espurna/static/index.small.html.ipp
generated
2986
code/espurna/static/index.small.html.ipp
generated
File diff suppressed because it is too large
Load Diff
3056
code/espurna/static/index.thermostat.html.ipp
generated
3056
code/espurna/static/index.thermostat.html.ipp
generated
File diff suppressed because it is too large
Load Diff
@@ -504,7 +504,11 @@ function modifyHtml(handlers) {
|
||||
|
||||
const dom = new JSDOM(source.contents, {includeNodeLocations: true});
|
||||
|
||||
const results = await Promise.all(handlers.map((x) => x(dom)));
|
||||
let results = [];
|
||||
for (const handler of handlers) {
|
||||
results.push(await Promise.resolve(handler(dom)));
|
||||
}
|
||||
|
||||
if (results.some((x) => x)) {
|
||||
source.contents = Buffer.from(dom.serialize());
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
/** @import { Plugin as EsbuildPlugin } from 'esbuild' */
|
||||
/** @import { Modules } from './preset.mjs' */
|
||||
/** @import { JSDOM } from 'jsdom' */
|
||||
|
||||
@@ -162,7 +161,7 @@ export async function maybeInline(dom, elem, {resolve, load, post} = {}) {
|
||||
* as the result, no code from the module should be bundled into the output when module was not initialized
|
||||
* however, since light module depends on iro.js and does not have `sideEffects: false` in package.json, it would still get bundled because of top-level import
|
||||
* (...and since module modifying something in global scope is not unheard of...)
|
||||
* @returns {EsbuildPlugin}
|
||||
* @returns {import('esbuild').Plugin}
|
||||
*/
|
||||
export function forceNoSideEffects() {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user