From: Bjørn Erik Pedersen Date: Fri, 13 Dec 2024 17:04:44 +0000 (+0100) Subject: js/esbuild: Batch: Avoid nil Instances slice X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4cbd4ef9913d9d167eec7dda029f4fe6f3b22bd8;p=brevno-suite%2Fhugo js/esbuild: Batch: Avoid nil Instances slice Ranging over a nil slice in Go works great, but is a hassle onced passed to JS. --- 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 {