summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2020-11-04 19:09:40 +0100
committerBjørn Erik Pedersen <[email protected]>2020-11-04 23:04:12 +0100
commit944150bafbbb5c3e807ba3688174e70764dbdc64 (patch)
tree23df3256e063c45d6886ef98cd903a5ea813b444
parentbf2837a314eaf70135791984a423b0b09f58741d (diff)
downloadhugo-944150bafbbb5c3e807ba3688174e70764dbdc64.tar.gz
hugo-944150bafbbb5c3e807ba3688174e70764dbdc64.zip
js: Remove external source map option
It was merged by accident and the implementation does not look correct. Fixes #7932
-rw-r--r--resources/resource_transformers/js/build.go3
-rw-r--r--resources/resource_transformers/js/options.go7
-rw-r--r--resources/resource_transformers/js/options_test.go4
3 files changed, 3 insertions, 11 deletions
diff --git a/resources/resource_transformers/js/build.go b/resources/resource_transformers/js/build.go
index 3a7065e0d..5ff21cf02 100644
--- a/resources/resource_transformers/js/build.go
+++ b/resources/resource_transformers/js/build.go
@@ -78,8 +78,7 @@ func (t *buildTransformation) Transform(ctx *resources.ResourceTransformationCtx
}
opts.sourcefile = ctx.SourcePath
- opts.workDir = t.c.rs.WorkingDir
- opts.resolveDir = opts.workDir
+ opts.resolveDir = t.c.rs.WorkingDir
opts.contents = string(src)
opts.mediaType = ctx.InMediaType
diff --git a/resources/resource_transformers/js/options.go b/resources/resource_transformers/js/options.go
index 654dbbab9..689efe0b4 100644
--- a/resources/resource_transformers/js/options.go
+++ b/resources/resource_transformers/js/options.go
@@ -93,7 +93,6 @@ type Options struct {
contents string
sourcefile string
resolveDir string
- workDir string
tsConfig string
}
@@ -365,12 +364,6 @@ func toBuildOptions(opts Options) (buildOptions api.BuildOptions, err error) {
switch opts.SourceMap {
case "inline":
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 "":
sourceMap = api.SourceMapNone
default:
diff --git a/resources/resource_transformers/js/options_test.go b/resources/resource_transformers/js/options_test.go
index abc8091a9..ef8c203ce 100644
--- a/resources/resource_transformers/js/options_test.go
+++ b/resources/resource_transformers/js/options_test.go
@@ -93,7 +93,7 @@ func TestToBuildOptions(t *testing.T) {
opts, err = toBuildOptions(Options{
Target: "es2018", Format: "cjs", Minify: true, mediaType: media.JavascriptType,
- SourceMap: "external"})
+ SourceMap: "inline"})
c.Assert(err, qt.IsNil)
c.Assert(opts, qt.DeepEquals, api.BuildOptions{
Bundle: true,
@@ -102,7 +102,7 @@ func TestToBuildOptions(t *testing.T) {
MinifyIdentifiers: true,
MinifySyntax: true,
MinifyWhitespace: true,
- Sourcemap: api.SourceMapExternal,
+ Sourcemap: api.SourceMapInline,
Stdin: &api.StdinOptions{
Loader: api.LoaderJS,
},