From a023888f4d199e22a477bc402936538bca23d879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Tue, 21 Jul 2020 17:59:03 +0200 Subject: [PATCH] resources/js: Add option for setting bundle format Fixes #7503 --- docs/content/en/hugo-pipes/js.md | 5 + media/mediaType.go | 5 + resources/postpub/fields_test.go | 1 + resources/resource_transformers/js/build.go | 126 ++++++++++++------ .../resource_transformers/js/build_test.go | 34 ++++- 5 files changed, 129 insertions(+), 42 deletions(-) diff --git a/docs/content/en/hugo-pipes/js.md b/docs/content/en/hugo-pipes/js.md index f361adc45c5..465854f3a19 100644 --- a/docs/content/en/hugo-pipes/js.md +++ b/docs/content/en/hugo-pipes/js.md @@ -45,6 +45,11 @@ defines [map] {{ $defines := dict "process.env.NODE_ENV" `"development"` }} ``` +format [string] {{< new-in "0.75.0" >}} +: The output format. + One of: `iife`, `cjs`, `esm`. + Default is `iife`, a self-executing function, suitable for inclusion as a