Skip to content

Commit

Permalink
Small refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Igmat committed Nov 4, 2016
1 parent d10f342 commit 77b44c8
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/transpile-if-ts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@ export function transpileIfTypescript(path, contents) {
if (path && (path.endsWith('.tsx') || path.endsWith('.ts'))) {

let transpiled = tsc.transpileModule(contents, {
compilerOptions: addSourceMapToTSConfig(),
compilerOptions: getTSConfig({ __TS_CONFIG__: global['__TS_CONFIG__'] }, true),
fileName: path
});

return transpiled.outputText;
}
return contents;
}

function addSourceMapToTSConfig() {
// if a global __TS_CONFIG__ is set, update the compiler setting to include inline SourceMap
var config = getTSConfig({ __TS_CONFIG__: global['__TS_CONFIG__'] }, true);
return config;
}

0 comments on commit 77b44c8

Please sign in to comment.