mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
Make js.Build fully support modules
Fixes #7816 Fixes #7777 Fixes #7916
This commit is contained in:
@@ -18,6 +18,7 @@ import (
|
||||
"io"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
@@ -296,21 +297,15 @@ func (c *ResourceCache) DeletePartitions(partitions ...string) {
|
||||
|
||||
}
|
||||
|
||||
func (c *ResourceCache) DeleteContains(parts ...string) {
|
||||
func (c *ResourceCache) DeleteMatches(re *regexp.Regexp) {
|
||||
c.Lock()
|
||||
defer c.Unlock()
|
||||
|
||||
for k := range c.cache {
|
||||
clear := false
|
||||
for _, part := range parts {
|
||||
if strings.Contains(k, part) {
|
||||
clear = true
|
||||
break
|
||||
}
|
||||
}
|
||||
if clear {
|
||||
if re.MatchString(k) {
|
||||
delete(c.cache, k)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user