<script async src="/assets/js/vendor/bootstrap.bundle.min.js"></script>

{{- $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" -}}
  <script async src="{{ $searchJs.Permalink | relURL }}"></script>
{{- end }}

{{- $application := resources.Get "js/application.js" | js.Build $esbuildOptions | resources.Copy "/assets/js/application.js" -}}
<script async src="{{ $application.Permalink | relURL }}"></script>
