From 5dfed495b824e0153d000047664c853fab20d096 Mon Sep 17 00:00:00 2001 From: Will Date: Mon, 6 Jan 2025 05:27:39 +0000 Subject: [PATCH] fix: add integrity to modulepreload links if defined (#400) --- src/generator.ts | 16 +++++++++++++--- test/html/preload.test.js | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/generator.ts b/src/generator.ts index 65a297e..c98712d 100644 --- a/src/generator.ts +++ b/src/generator.ts @@ -837,11 +837,21 @@ export class Generator { for (let dep of preloadDeps.sort()) { if (first || whitespace) preloads += newlineTab; if (first) first = false; - preloads += ``; + : dep; + preloads += ``; } } diff --git a/test/html/preload.test.js b/test/html/preload.test.js index d00be51..48db89d 100644 --- a/test/html/preload.test.js +++ b/test/html/preload.test.js @@ -105,7 +105,7 @@ assert.strictEqual( "\n" + `\n` + `\n` + - '\n' + + `\n` + '\n"