From 2204a1984157dd366a3a56328d3ab42d85aa6e38 Mon Sep 17 00:00:00 2001 From: Jakob Scheid Date: Wed, 29 Jul 2026 22:09:23 +0200 Subject: [PATCH] feat(legal): minify imprint HTML when building --- build/plugins/legal.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build/plugins/legal.js b/build/plugins/legal.js index 945a0bc..b2273c8 100644 --- a/build/plugins/legal.js +++ b/build/plugins/legal.js @@ -14,6 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ +import { minify } from 'html-minifier-terser'; import MarkdownIt from 'markdown-it'; import { mkdir, readFile, writeFile } from 'node:fs/promises'; @@ -23,6 +24,13 @@ export default async function build () { const legalNoticeMd = await readFile('./src/legal/legal_notice.md', { encoding: 'utf-8' }); const legalNoticeHtml = md.render(legalNoticeMd); + const legalNoticeHtmlMinified = await minify(legalNoticeHtml, { + collapseWhitespace: true, + conservativeCollapse: true, + collapseInlineTagWhitespace: true, + removeComments: true + }); + return { artifacts: [ { @@ -30,7 +38,7 @@ export default async function build () { path: 'legal/legal_notice.html', type: 'text', options: { - content: legalNoticeHtml, + content: legalNoticeHtmlMinified, encoding: 'utf-8' } }