Skip to content

Commit 788dd49

Browse files
authored
feat: add fingerprints to the JS file URL to utilize HTTP caching (#1076)
1 parent 8a7fb33 commit 788dd49

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{{- partial "helper/external" (dict "Context" . "Namespace" "Vibrant") -}}
22

33
{{- $opts := dict "minify" hugo.IsProduction -}}
4-
{{- $script := resources.Get "ts/main.ts" | js.Build $opts -}}
4+
{{- $script := resources.Get "ts/main.ts" | js.Build $opts | fingerprint -}}
55

66
<script type="text/javascript" src="{{ $script.RelPermalink }}" defer></script>
77

88
{{- with resources.Get "ts/custom.ts" -}}
99
{{/* Place your custom script in HUGO_SITE_FOLDER/assets/ts/custom.ts */}}
10-
{{- $customScript := . | js.Build $opts -}}
10+
{{- $customScript := . | js.Build $opts | fingerprint -}}
1111
<script type="text/javascript" src="{{ $customScript.RelPermalink }}" defer></script>
1212
{{- end -}}

0 commit comments

Comments
 (0)