Skip to content

Commit

Permalink
js: Remove external source map option
Browse files Browse the repository at this point in the history
It was merged by accident and the implementation does not look correct.

Fixes #7932
  • Loading branch information
bep committed Nov 4, 2020
1 parent bf2837a commit 944150b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
3 changes: 1 addition & 2 deletions resources/resource_transformers/js/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 0 additions & 7 deletions resources/resource_transformers/js/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ type Options struct {
contents string
sourcefile string
resolveDir string
workDir string
tsConfig string
}

Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions resources/resource_transformers/js/options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
},
Expand Down

0 comments on commit 944150b

Please sign in to comment.