aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-12-13 18:04:44 +0100
committerBjørn Erik Pedersen <[email protected]>2024-12-16 08:33:10 +0100
commit4cbd4ef9913d9d167eec7dda029f4fe6f3b22bd8 (patch)
tree8eb0acdd2755126cd008a82411b3b68a8ae142e9
parenta32c889a7b1b6cb7b9a80b4fbab342d9b660a988 (diff)
downloadhugo-4cbd4ef9913d9d167eec7dda029f4fe6f3b22bd8.tar.gz
hugo-4cbd4ef9913d9d167eec7dda029f4fe6f3b22bd8.zip
js/esbuild: Batch: Avoid nil Instances slice
Ranging over a nil slice in Go works great, but is a hassle onced passed to JS.
-rw-r--r--internal/js/esbuild/batch.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/js/esbuild/batch.go b/internal/js/esbuild/batch.go
index 1a8a7b09a..688b58d21 100644
--- a/internal/js/esbuild/batch.go
+++ b/internal/js/esbuild/batch.go
@@ -506,8 +506,9 @@ func (b *batcher) doBuild(ctx context.Context) (*Package, error) {
})
bt := scriptBatchTemplateContext{
- opts: vv,
- Import: impPath,
+ opts: vv,
+ Import: impPath,
+ Instances: []scriptInstanceBatchTemplateContext{},
}
state.importResource.Set(bt.Import, vv.Compiled().Resource)
predicate := func(k instanceID) bool {