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

Commit

Permalink
Don't use compilerContext to pass inputSourceMap to babel
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterthanlime committed Jun 22, 2017
1 parent e90c3b0 commit 262476a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/js/babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default class BabelCompiler extends SimpleCompilerBase {
filename: filePath,
ast: false,
babelrc: false
}, compilerContext);
});

let useCoverage = false;
if ('coverage' in opts) {
Expand Down
5 changes: 3 additions & 2 deletions src/js/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,14 @@ export default class TypeScriptCompiler extends SimpleCompilerBase {
babelOpts.sourceMaps = true;
}

this.babel.compilerOptions = babelOpts;
this.babelOpts = babelOpts;
}

let babelOutput = this.babel.compileSync(code, filePath, {
this.babel.compilerOptions = Object.assign({}, this.babelOpts, {
// babel API wants sourceMap as an object or a path. let's not touch the disk.
inputSourceMap: sourceMaps ? JSON.parse(sourceMaps) : null,
});
let babelOutput = this.babel.compileSync(code, filePath, {});

// babel-transformed, potentially instrumented code
code = babelOutput.code;
Expand Down

0 comments on commit 262476a

Please sign in to comment.