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

Commit ad072eb

Browse files
committed
source maps fix
1 parent bc2a46a commit ad072eb

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

src/transpiler.js

+3-12
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,8 @@ var transpile = (function() {
2323
else
2424
transpileFunction = babelTranspile;
2525

26-
return '(function(__moduleName, __moduleAddress) {'
27-
+ transpileFunction.call(self, load, transpiler)
28-
+ '\n}).call({}, "' + load.name + '", "' + load.address + '");'
29-
+ '\n//# sourceURL=' + load.address + '!transpiled';
30-
31-
// sourceURL and sourceMappingURL:
32-
// Ideally we wouldn't need a sourceURL and would just use the sourceMap.
33-
// But without the sourceURL as well, line-by-line debugging doesn't work.
34-
// We thus need to ensure the sourceURL is a different name to the original
35-
// source, and hence the !transpiled suffix.
26+
// note __moduleName will be part of the transformer meta in future when we have the spec for this
27+
return 'var __moduleName = "' + load.name + '";' + transpileFunction.call(self, load, transpiler) + '\n//# sourceURL=' + load.address + '!transpiled';
3628
});
3729
};
3830

@@ -78,8 +70,7 @@ var transpile = (function() {
7870
options.module = ts.ModuleKind.System;
7971
options.inlineSourceMap = true;
8072

81-
var source = ts.transpile(load.source, options, load.address);
82-
return source + '\n//# sourceURL=' + load.address + '!eval';;
73+
return ts.transpile(load.source, options, load.address);
8374
}
8475

8576
return transpile;

0 commit comments

Comments
 (0)