From: Julien Déramond Date: Tue, 5 Aug 2025 18:55:52 +0000 (+0200) Subject: Docs: unminify package example HTML files (#41637) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1eccc810f0db3ac84587d647ab33e99ee8bf82e5;p=thirdparty%2Fbootstrap.git Docs: unminify package example HTML files (#41637) --- diff --git a/build/zip-examples.mjs b/build/zip-examples.mjs index 03995efd53..6b2e1e0dac 100644 --- a/build/zip-examples.mjs +++ b/build/zip-examples.mjs @@ -11,6 +11,7 @@ import fs from 'node:fs/promises' import path from 'node:path' import { fileURLToPath } from 'node:url' import sh from 'shelljs' +import { format } from 'prettier' const __dirname = path.dirname(fileURLToPath(import.meta.url)) @@ -83,7 +84,9 @@ for (const file of staticJsFiles) { sh.rm(`${distFolder}/index.html`) // get all examples' HTML files -for (const file of sh.find(`${distFolder}/**/*.html`)) { +const htmlFiles = sh.find(`${distFolder}/**/*.html`) + +const formatPromises = htmlFiles.map(async file => { const fileContents = sh.cat(file) .toString() .replace(new RegExp(`"/docs/${versionShort}/`, 'g'), '"../') @@ -91,8 +94,24 @@ for (const file of sh.find(`${distFolder}/**/*.html`)) { .replace(/(]*) integrity="[^"]*"/g, '$1') .replace(/]*href="\.\.\/assets\/img\/favicons\/[^"]*"[^>]*>/g, '') .replace(/(