From 788dd497b3ce50d27be34c304e74dcd92930c8b9 Mon Sep 17 00:00:00 2001 From: xiaoxiyao Date: Sun, 20 Oct 2024 03:14:35 +0800 Subject: [PATCH] feat: add fingerprints to the JS file URL to utilize HTTP caching (#1076) --- 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