}
  {{- with .babel -}}
    {{- if eq . true -}}
      {{- $babel = true -}}
    {{- else -}}
      {{- errorf "Invalid .babel option of %q. The only valid option is true" . -}}
    {{- end -}}
  {{- end -}}
{{ end }}

{{- /* get the resource from .src path */ -}}
{{- $resource := resources.Get $src -}}

{{- /* if resources.Get fails */ -}}
{{- if not $resource }}
  {{- errorf "No js resource found at /assets/%s" $src -}}
{{- end -}}

{{- /* pass hugo env to the js file as a param */ -}}
{{- /* $params := (