aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/site.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2024-12-16 08:34:17 +0100
committerBjørn Erik Pedersen <[email protected]>2024-12-16 11:52:18 +0100
commit565c30eac9e00b2ebcbdbb8e05b5e8238a15fefb (patch)
treed7a8e84098dbca1dce0d52ab0941178949532a19 /hugolib/site.go
parent48dd6a918a0ef070819ef80d59b2553bc99e2964 (diff)
downloadhugo-565c30eac9e00b2ebcbdbb8e05b5e8238a15fefb.tar.gz
hugo-565c30eac9e00b2ebcbdbb8e05b5e8238a15fefb.zip
js: Fix js.Batch for multihost setups
Note that this is an unreleased feature. Fixes #13151
Diffstat (limited to 'hugolib/site.go')
-rw-r--r--hugolib/site.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/hugolib/site.go b/hugolib/site.go
index f73bd2517..4e2497ee1 100644
--- a/hugolib/site.go
+++ b/hugolib/site.go
@@ -42,6 +42,7 @@ import (
"github.com/gohugoio/hugo/deps"
"github.com/gohugoio/hugo/hugolib/doctree"
"github.com/gohugoio/hugo/hugolib/pagesfromdata"
+ "github.com/gohugoio/hugo/internal/js/esbuild"
"github.com/gohugoio/hugo/internal/warpc"
"github.com/gohugoio/hugo/langs/i18n"
"github.com/gohugoio/hugo/modules"
@@ -205,6 +206,12 @@ func NewHugoSites(cfg deps.DepsCfg) (*HugoSites, error) {
return nil, err
}
+ batcherClient, err := esbuild.NewBatcherClient(firstSiteDeps)
+ if err != nil {
+ return nil, err
+ }
+ firstSiteDeps.JSBatcherClient = batcherClient
+
confm := cfg.Configs
if err := confm.Validate(logger); err != nil {
return nil, err
@@ -313,7 +320,6 @@ func NewHugoSites(cfg deps.DepsCfg) (*HugoSites, error) {
return li.Lang < lj.Lang
})
- var err error
h, err = newHugoSites(cfg, firstSiteDeps, pageTrees, sites)
if err == nil && h == nil {
panic("hugo: newHugoSitesNew returned nil error and nil HugoSites")