From d6d6638d92e1317e85daa63d0188ef349a279c5a Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Sat, 17 Sep 2022 11:45:03 +0800 Subject: [PATCH] :zap: Perf: optimize custom.js minify --- layouts/partials/assets.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/assets.html b/layouts/partials/assets.html index 1a894251..44d5c2bf 100644 --- a/layouts/partials/assets.html +++ b/layouts/partials/assets.html @@ -264,7 +264,7 @@ {{- /* Custom script */ -}} {{- with ((resources.Get "js/custom.js") | default (resources.Get "js/_custom.js")) -}} - {{- dict "Source" . "Minify" true "Fingerprint" $fingerprint "Defer" true | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}} + {{- dict "Source" . "Minify" hugo.IsProduction "Fingerprint" $fingerprint "Defer" true | dict "Scratch" $.Scratch "Data" | partial "scratch/script.html" -}} {{- end -}} {{- with (.Scratch.Get "this").scriptArr -}}