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

@@ -37,6 +37,7 @@ import (
const (
metaKeyFilename = "filename"
metaKeySourceRoot = "sourceRoot"
metaKeyBaseDir = "baseDir" // Abs base directory of source file.
metaKeyMountRoot = "mountRoot"
metaKeyModule = "module"
@@ -128,6 +129,10 @@ func (f FileMeta) PathFile() string {
return strings.TrimPrefix(strings.TrimPrefix(f.Filename(), base), filepathSeparator)
}
func (f FileMeta) SourceRoot() string {
return f.stringV(metaKeySourceRoot)
}
func (f FileMeta) MountRoot() string {
return f.stringV(metaKeyMountRoot)
}