Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
compiler.writeTreeToFile = function(tree, filename) {
filename = this.normalize(filename);
// This is changed.
// Pass sourceRoot to `this.write`. Traceur does not pass it through.
var compiledCode = this.write(tree, filename, sourceRoot);
if (this.options_.sourceMaps === 'file') {
var sourcemap = this.getSourceMap();
if (sourcemap) {
// This is changed.
// Generate the source map in the same folder as the output JS file.
writeFile(filename.replace(/\.js$/, '.map'), sourcemap);
}
}
writeFile(filename, compiledCode);
};
compiler.writeTreeToFile = function(tree, filename) {
filename = this.normalize(filename);
// This is changed.
// Pass sourceRoot to `this.write`. Traceur does not pass it through.
var compiledCode = this.write(tree, filename, sourceRoot);
if (this.options_.sourceMaps === 'file') {
var sourcemap = this.getSourceMap();
if (sourcemap) {
// This is changed.
// Generate the source map in the same folder as the output JS file.
writeFile(filename.replace(/\.js$/, '.map'), sourcemap);
}
}
writeFile(filename, compiledCode);
};