From af938a62ea42687c8e3284b3e3072f1a9c65563e Mon Sep 17 00:00:00 2001 From: xiaoxiyao Date: Mon, 23 Sep 2024 17:13:57 +0800 Subject: [PATCH] feat: Add fingerprints to the JS file URL to utilize HTTP caching. --- layouts/partials/footer/components/script.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/footer/components/script.html b/layouts/partials/footer/components/script.html index 4cb350c..3dc96cb 100644 --- a/layouts/partials/footer/components/script.html +++ b/layouts/partials/footer/components/script.html @@ -1,12 +1,12 @@ {{- partial "helper/external" (dict "Context" . "Namespace" "Vibrant") -}} {{- $opts := dict "minify" hugo.IsProduction -}} -{{- $script := resources.Get "ts/main.ts" | js.Build $opts -}} +{{- $script := resources.Get "ts/main.ts" | js.Build $opts | fingerprint -}} {{- with resources.Get "ts/custom.ts" -}} {{/* Place your custom script in HUGO_SITE_FOLDER/assets/ts/custom.ts */}} - {{- $customScript := . | js.Build $opts -}} + {{- $customScript := . | js.Build $opts | fingerprint -}} {{- end -}} \ No newline at end of file