tpl/tplimpl/embedded/templates/_hugo/build/js/batch-esm-runner.gotmpl
raw| 1 | {{ range $i, $e := .Scripts -}} |
| 2 | {{ printf "import { %s as Script%d } from %q;" .Export $i .Import }} |
| 3 | {{ end -}} |
| 4 | {{ range $i, $e := .Runners }} |
| 5 | {{ printf "import { %s as Run%d } from %q;" .Export $i .Import }} |
| 6 | {{ end }} |
| 7 | {{/* */}} |
| 8 | let scripts = []; |
| 9 | {{ range $i, $e := .Scripts -}} |
| 10 | scripts.push({{ .RunnerJSON $i }}); |
| 11 | {{ end -}} |
| 12 | {{/* */}} |
| 13 | {{ range $i, $e := .Runners }} |
| 14 | {{ $id := printf "Run%d" $i }} |
| 15 | {{ $id }}(scripts); |
| 16 | {{ end }} |