js: Fix potential path issue on Windows

This commit is contained in:
Bjørn Erik Pedersen
2021-02-01 12:49:08 +01:00
parent a9b0fea6a3
commit b60e9279ab
2 changed files with 4 additions and 4 deletions

View File

@@ -81,8 +81,8 @@ func (t *buildTransformation) Transform(ctx *resources.ResourceTransformationCtx
return err
}
opts.sourcefile = ctx.SourcePath
opts.resolveDir = t.c.rs.WorkingDir
opts.sourceDir = filepath.FromSlash(path.Dir(ctx.SourcePath))
opts.resolveDir = t.c.rs.WorkingDir // where node_modules gets resolved
opts.contents = string(src)
opts.mediaType = ctx.InMediaType