jspm_packages/npm/babel-core@5.8.38/lib/api/register/node.js
function compile(filename) {
  var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

  var result;

  opts.filename = filename;

  var optsManager = new _transformationFileOptionsOptionManager2["default"]();
  optsManager.mergeOptions(transformOpts);
  opts = optsManager.init(opts);

  var cacheKey = JSON.stringify(opts) + ":" + babel.version;

  var env = process.env.BABEL_ENV || process.env.NODE_ENV;
  if (env) cacheKey += ":" + env;

  if (cache) {
    var cached = cache[cacheKey];
    if (cached && cached.mtime === mtime(filename)) {
      result = cached;
    }
  }

  if (!result) {
    result = babel.transformFileSync(filename, _lodashObjectExtend2["default"](opts, {
      sourceMap: "both",
      ast: false
    }));
  }

  if (cache) {
    result.mtime = mtime(filename);
    cache[cacheKey] = result;
  }

  maps[filename] = result.map;

  return result.code;
}
function compile(filename) {
  var opts = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];

  var result;

  opts.filename = filename;

  var optsManager = new _transformationFileOptionsOptionManager2["default"]();
  optsManager.mergeOptions(transformOpts);
  opts = optsManager.init(opts);

  var cacheKey = JSON.stringify(opts) + ":" + babel.version;

  var env = process.env.BABEL_ENV || process.env.NODE_ENV;
  if (env) cacheKey += ":" + env;

  if (cache) {
    var cached = cache[cacheKey];
    if (cached && cached.mtime === mtime(filename)) {
      result = cached;
    }
  }

  if (!result) {
    result = babel.transformFileSync(filename, _lodashObjectExtend2["default"](opts, {
      sourceMap: "both",
      ast: false
    }));
  }

  if (cache) {
    result.mtime = mtime(filename);
    cache[cacheKey] = result;
  }

  maps[filename] = result.map;

  return result.code;
}
function compile ( filename ) { var opts = arguments . length <= 1 || arguments [ 1 ] === undefined ? { } : arguments [ 1 ] ; var result ; opts . filename = filename ; var optsManager = new _transformationFileOptionsOptionManager2 [ "default" ] ( ) ; optsManager . mergeOptions ( transformOpts ) ; opts = optsManager . init ( opts ) ; var cacheKey = JSON . stringify ( opts ) + ":" + babel . version ; var env = process . env . BABEL_ENV || process . env . NODE_ENV ; if ( env ) cacheKey += ":" + env ; if ( cache ) { var cached = cache [ cacheKey ] ; if ( cached && cached . mtime === mtime ( filename ) ) { result = cached ; } } if ( ! result ) { result = babel . transformFileSync ( filename , _lodashObjectExtend2 [ "default" ] ( opts , { sourceMap : "both" , ast : false } ) ) ; } if ( cache ) { result . mtime = mtime ( filename ) ; cache [ cacheKey ] = result ; } maps [ filename ] = result . map ; return result . code ; }
Compile a `filename` with optional `opts`.
Compile a filename with optional opts .