mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 06:00:25 +03:00
Make js.Build fully support modules
Fixes #7816 Fixes #7777 Fixes #7916
This commit is contained in:
parent
3089fc0ba1
commit
85e4dd7370
22 changed files with 949 additions and 988 deletions
|
@ -23,6 +23,8 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/gohugoio/hugo/resources/jsconfig"
|
||||
|
||||
"github.com/gohugoio/hugo/common/herrors"
|
||||
|
||||
"github.com/gohugoio/hugo/config"
|
||||
|
@ -76,17 +78,20 @@ func NewSpec(
|
|||
}
|
||||
|
||||
rs := &Spec{
|
||||
PathSpec: s,
|
||||
Logger: logger,
|
||||
ErrorSender: errorHandler,
|
||||
imaging: imaging,
|
||||
incr: incr,
|
||||
MediaTypes: mimeTypes,
|
||||
OutputFormats: outputFormats,
|
||||
Permalinks: permalinks,
|
||||
BuildConfig: config.DecodeBuild(s.Cfg),
|
||||
FileCaches: fileCaches,
|
||||
PostProcessResources: make(map[string]postpub.PostPublishedResource),
|
||||
PathSpec: s,
|
||||
Logger: logger,
|
||||
ErrorSender: errorHandler,
|
||||
imaging: imaging,
|
||||
incr: incr,
|
||||
MediaTypes: mimeTypes,
|
||||
OutputFormats: outputFormats,
|
||||
Permalinks: permalinks,
|
||||
BuildConfig: config.DecodeBuild(s.Cfg),
|
||||
FileCaches: fileCaches,
|
||||
PostBuildAssets: &PostBuildAssets{
|
||||
PostProcessResources: make(map[string]postpub.PostPublishedResource),
|
||||
JSConfigBuilder: jsconfig.NewBuilder(),
|
||||
},
|
||||
imageCache: newImageCache(
|
||||
fileCaches.ImageCache(),
|
||||
|
||||
|
@ -121,8 +126,15 @@ type Spec struct {
|
|||
ResourceCache *ResourceCache
|
||||
FileCaches filecache.Caches
|
||||
|
||||
// Assets used after the build is done.
|
||||
// This is shared between all sites.
|
||||
*PostBuildAssets
|
||||
}
|
||||
|
||||
type PostBuildAssets struct {
|
||||
postProcessMu sync.RWMutex
|
||||
PostProcessResources map[string]postpub.PostPublishedResource
|
||||
JSConfigBuilder *jsconfig.Builder
|
||||
}
|
||||
|
||||
func (r *Spec) New(fd ResourceSourceDescriptor) (resource.Resource, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue