{{- $esbuildOptions := dict "target" "es2019" -}} {{- if eq hugo.Environment "production" -}} {{- $esbuildOptions = merge $esbuildOptions (dict "minify" "true") -}} {{- end -}} {{- if or .IsHome (eq .Page.Layout "sprite") -}} {{- $searchJs := resources.Get "js/search.js" | js.Build $esbuildOptions | resources.Copy "/assets/js/search.js" -}} {{- end }} {{- $application := resources.Get "js/application.js" | js.Build $esbuildOptions | resources.Copy "/assets/js/application.js" -}}