{{ $bootstrapJs := resources.Get "/js/vendor/bootstrap.bundle.min.js" | resources.Copy "/assets/js/vendor/bootstrap.bundle.min.js" -}}
<script async src="{{ $bootstrapJs.Permalink | relURL }}"></script>

{{- if or .IsHome (eq .Page.Layout "sprite") -}}
  {{- $listVendor := resources.Get "js/vendor/list.min.js" -}}
  {{- $listJs := resources.Get "js/list.js" -}}
  {{- $listBundle := slice $listVendor $listJs | resources.Concat "assets/js/list.js" -}}

  {{- if eq hugo.Environment "production" -}}
    {{- $listBundle = $listBundle | resources.Minify -}}
  {{- end }}
  <script async src="{{ $listBundle.Permalink | relURL }}"></script>
{{- end }}

{{- $clipboardVendor := resources.Get "js/vendor/clipboard.min.js" -}}
{{- $applicationJs := resources.Get "js/application.js" -}}
{{- $applicationBundle := slice $clipboardVendor $applicationJs | resources.Concat "assets/js/application.js" -}}

{{- if eq hugo.Environment "production" -}}
  {{- $applicationBundle = $applicationBundle | resources.Minify -}}
{{- end }}
<script async src="{{ $applicationBundle.Permalink | relURL }}"></script>
