Skip to content
This repository has been archived by the owner on Oct 9, 2020. It is now read-only.

Commit

Permalink
make TypeScript transpile accept dependency map and return source maps
Browse files Browse the repository at this point in the history
  • Loading branch information
vladima committed Aug 15, 2015
1 parent 867b76a commit 4cd9efe
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions compilers/esm.js
Expand Up @@ -96,13 +96,19 @@ exports.compile = function(load, opts, loader) {
if (options.target === undefined)
options.target = transpiler.ScriptTarget.ES5;
options.module = transpiler.ModuleKind.System;

source = transpiler.transpile(source, options, load.address, undefined, !opts.anonymous && load.name);

var transpileOptions = {
compilerOptions: options,
renamedDependencies: load.depMap,
fileName: load.address,
moduleName: !opts.anonymous && load.name
};

var transpiled = transpiler.transpileModule(source, transpileOptions);

return Promise.resolve({
source: source,
// TODO pipe TypeScript sourcemaps
// sourceMap: {...}
source: transpiled.outputText,
sourceMap: transpiled.sourceMapText
});
}
else {
Expand Down

0 comments on commit 4cd9efe

Please sign in to comment.