Skip to content
This repository was archived by the owner on Jul 13, 2020. It is now read-only.

Commit 56e3cf7

Browse files
committed
allow sourceMaps false in transpiler options (#418)
1 parent 396a935 commit 56e3cf7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/transpiler.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ var transpile = (function() {
3232
var options = this.traceurOptions || {};
3333
options.modules = 'instantiate';
3434
options.script = false;
35-
options.sourceMaps = 'inline';
35+
if (options.sourceMaps === undefined)
36+
options.sourceMaps = 'inline';
3637
options.filename = load.address;
3738
options.inputSourceMap = load.metadata.sourceMap;
3839
options.moduleName = false;
@@ -54,7 +55,8 @@ var transpile = (function() {
5455
function babelTranspile(load, babel) {
5556
var options = this.babelOptions || {};
5657
options.modules = 'system';
57-
options.sourceMap = 'inline';
58+
if (options.sourceMap === undefined)
59+
options.sourceMap = 'inline';
5860
options.inputSourceMap = load.metadata.sourceMap;
5961
options.filename = load.address;
6062
options.code = true;
@@ -65,11 +67,13 @@ var transpile = (function() {
6567

6668
function typescriptTranspile(load, ts) {
6769
var options = this.typescriptOptions || {};
68-
if (options.target === undefined) {
69-
options.target = ts.ScriptTarget.ES5;
70-
}
70+
options.target = options.target || ts.ScriptTarget.ES5;
71+
if (options.sourceMap === undefined)
72+
options.sourceMap = true;
73+
if (options.sourceMap)
74+
options.inlineSourceMap = true;
75+
7176
options.module = ts.ModuleKind.System;
72-
options.inlineSourceMap = true;
7377

7478
return ts.transpile(load.source, options, load.address);
7579
}

0 commit comments

Comments
 (0)