fix: unminified JavaScript (#2305)

Appears that behavior of recent Hugo versions changed w.r.t. JS formatting
This commit is contained in:
Alexander Zhang authored and GitHub committed 2021-05-25 19:32:39 +01:00
1 parent 14aea8f8a3
commit b860e6c775
1 file changed
+6 -6
+6 -6
View File
@@ -137,16 +137,16 @@
{{ range site.Params.plugins_js }}
{{ $js_bundle = $js_bundle | append (resources.Get (printf "js/%s.js" .)) }}
{{ end }}
{{ $js_bundle := $js_bundle | resources.Concat (printf "%s/js/wowchemy-bundle.js" .Lang) }}
{{ $js_bundle = $js_bundle | resources.Concat (printf "%s/js/wowchemy-bundle.js" .Lang) }}
{{- if hugo.IsProduction -}}
{{ $js_bundle = $js_bundle | minify }}
{{- end -}}
{{ $js_bundle := slice $js_bundle_head $js_bundle | resources.Concat (printf "%s/js/wowchemy.min.js" .Lang) }}
{{- if hugo.IsProduction -}}
{{- $js_bundle = $js_bundle | js.Build (dict "format" "iife") | fingerprint "md5" -}}
{{- $js_bundle = $js_bundle | js.Build (dict "format" "iife") | minify -}}
{{- else -}}
{{- $js_bundle = $js_bundle | js.Build (dict "format" "iife" "sourceMap" "inline") -}}
{{- end -}}
{{ $js_bundle = slice $js_bundle_head $js_bundle | resources.Concat (printf "%s/js/wowchemy.min.js" .Lang) }}
{{- if hugo.IsProduction -}}
{{ $js_bundle = $js_bundle | fingerprint "md5" }}
{{- end -}}
<script src="{{ $js_bundle.RelPermalink }}"></script>
{{ partial "custom_js" . }}