From 5ebeb377d0da317e6f8c4b181b7d9e9dc96a2700 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 17 Dec 2024 13:54:17 +0000 Subject: [PATCH] refactor(@angular/ssr): mark `LINK_LOAD_SCRIPT_CONTENT` as `@PURE` This const is pure. (cherry picked from commit f7c0a83c5d271a2a63adb150854ff599d45f6c49) --- packages/angular/ssr/src/utils/inline-critical-css.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/angular/ssr/src/utils/inline-critical-css.ts b/packages/angular/ssr/src/utils/inline-critical-css.ts index f79f065a8621..5a5eb011c20a 100644 --- a/packages/angular/ssr/src/utils/inline-critical-css.ts +++ b/packages/angular/ssr/src/utils/inline-critical-css.ts @@ -32,8 +32,7 @@ const CSP_MEDIA_ATTR = 'ngCspMedia'; * - Removes the event listener when all relevant `` tags have been processed. * - Uses event capturing (the `true` parameter) since load events do not bubble up the DOM. */ -const LINK_LOAD_SCRIPT_CONTENT = ` -(() => { +const LINK_LOAD_SCRIPT_CONTENT = /* @__PURE__ */ (() => `(() => { const CSP_MEDIA_ATTR = '${CSP_MEDIA_ATTR}'; const documentElement = document.documentElement; @@ -57,7 +56,7 @@ const LINK_LOAD_SCRIPT_CONTENT = ` }; documentElement.addEventListener('load', listener, true); -})();`; +})();`)(); /** Partial representation of an `HTMLElement`. */ interface PartialHTMLElement {