mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
js: Fix potential path issue on Windows
This commit is contained in:
parent
a9b0fea6a3
commit
b60e9279ab
2 changed files with 4 additions and 4 deletions
|
@ -81,8 +81,8 @@ func (t *buildTransformation) Transform(ctx *resources.ResourceTransformationCtx
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
opts.sourcefile = ctx.SourcePath
|
opts.sourceDir = filepath.FromSlash(path.Dir(ctx.SourcePath))
|
||||||
opts.resolveDir = t.c.rs.WorkingDir
|
opts.resolveDir = t.c.rs.WorkingDir // where node_modules gets resolved
|
||||||
opts.contents = string(src)
|
opts.contents = string(src)
|
||||||
opts.mediaType = ctx.InMediaType
|
opts.mediaType = ctx.InMediaType
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ type Options struct {
|
||||||
mediaType media.Type
|
mediaType media.Type
|
||||||
outDir string
|
outDir string
|
||||||
contents string
|
contents string
|
||||||
sourcefile string
|
sourceDir string
|
||||||
resolveDir string
|
resolveDir string
|
||||||
tsConfig string
|
tsConfig string
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,7 @@ func createBuildPlugins(c *Client, opts Options) ([]api.Plugin, error) {
|
||||||
}
|
}
|
||||||
relDir = filepath.Dir(rel)
|
relDir = filepath.Dir(rel)
|
||||||
} else {
|
} else {
|
||||||
relDir = filepath.Dir(opts.sourcefile)
|
relDir = opts.sourceDir
|
||||||
}
|
}
|
||||||
|
|
||||||
// Imports not starting with a "." is assumed to live relative to /assets.
|
// Imports not starting with a "." is assumed to live relative to /assets.
|
||||||
|
|
Loading…
Reference in a new issue