diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-12-13 18:04:44 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-12-16 08:33:10 +0100 |
commit | 4cbd4ef9913d9d167eec7dda029f4fe6f3b22bd8 (patch) | |
tree | 8eb0acdd2755126cd008a82411b3b68a8ae142e9 | |
parent | a32c889a7b1b6cb7b9a80b4fbab342d9b660a988 (diff) | |
download | hugo-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.go | 5 |
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 { |