Make js.Build fully support modules

Fixes #7816
Fixes #7777
Fixes #7916
This commit is contained in:
Bjørn Erik Pedersen
2020-10-05 13:34:14 +02:00
parent 3089fc0ba1
commit 85e4dd7370
22 changed files with 949 additions and 988 deletions

View File

@@ -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)
}
}
}