How to use the traceur/src/node/file-util.writeFile function in traceur

To help you get started, we’ve selected a few traceur examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hannahhoward / a1atscript / webstorm_traceur.js View on Github external
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);
};
github hannahhoward / a1atscript / webstorm_traceur.js View on Github external
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);
};