mirror of
https://github.com/gohugoio/hugo.git
synced 2025-02-19 21:32:35 +00:00
js: Remove external source map option
It was merged by accident and the implementation does not look correct. Fixes #7932
This commit is contained in:
parent
bf2837a314
commit
944150bafb
3 changed files with 3 additions and 11 deletions
|
@ -78,8 +78,7 @@ func (t *buildTransformation) Transform(ctx *resources.ResourceTransformationCtx
|
||||||
}
|
}
|
||||||
|
|
||||||
opts.sourcefile = ctx.SourcePath
|
opts.sourcefile = ctx.SourcePath
|
||||||
opts.workDir = t.c.rs.WorkingDir
|
opts.resolveDir = t.c.rs.WorkingDir
|
||||||
opts.resolveDir = opts.workDir
|
|
||||||
opts.contents = string(src)
|
opts.contents = string(src)
|
||||||
opts.mediaType = ctx.InMediaType
|
opts.mediaType = ctx.InMediaType
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,6 @@ type Options struct {
|
||||||
contents string
|
contents string
|
||||||
sourcefile string
|
sourcefile string
|
||||||
resolveDir string
|
resolveDir string
|
||||||
workDir string
|
|
||||||
tsConfig string
|
tsConfig string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,12 +364,6 @@ func toBuildOptions(opts Options) (buildOptions api.BuildOptions, err error) {
|
||||||
switch opts.SourceMap {
|
switch opts.SourceMap {
|
||||||
case "inline":
|
case "inline":
|
||||||
sourceMap = api.SourceMapInline
|
sourceMap = api.SourceMapInline
|
||||||
case "external":
|
|
||||||
// When doing external sourcemaps we should specify
|
|
||||||
// out file and no out dir
|
|
||||||
sourceMap = api.SourceMapExternal
|
|
||||||
outFile = filepath.Join(opts.workDir, opts.TargetPath)
|
|
||||||
outDir = ""
|
|
||||||
case "":
|
case "":
|
||||||
sourceMap = api.SourceMapNone
|
sourceMap = api.SourceMapNone
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -93,7 +93,7 @@ func TestToBuildOptions(t *testing.T) {
|
||||||
|
|
||||||
opts, err = toBuildOptions(Options{
|
opts, err = toBuildOptions(Options{
|
||||||
Target: "es2018", Format: "cjs", Minify: true, mediaType: media.JavascriptType,
|
Target: "es2018", Format: "cjs", Minify: true, mediaType: media.JavascriptType,
|
||||||
SourceMap: "external"})
|
SourceMap: "inline"})
|
||||||
c.Assert(err, qt.IsNil)
|
c.Assert(err, qt.IsNil)
|
||||||
c.Assert(opts, qt.DeepEquals, api.BuildOptions{
|
c.Assert(opts, qt.DeepEquals, api.BuildOptions{
|
||||||
Bundle: true,
|
Bundle: true,
|
||||||
|
@ -102,7 +102,7 @@ func TestToBuildOptions(t *testing.T) {
|
||||||
MinifyIdentifiers: true,
|
MinifyIdentifiers: true,
|
||||||
MinifySyntax: true,
|
MinifySyntax: true,
|
||||||
MinifyWhitespace: true,
|
MinifyWhitespace: true,
|
||||||
Sourcemap: api.SourceMapExternal,
|
Sourcemap: api.SourceMapInline,
|
||||||
Stdin: &api.StdinOptions{
|
Stdin: &api.StdinOptions{
|
||||||
Loader: api.LoaderJS,
|
Loader: api.LoaderJS,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue