react-native/packager/transformer.js
function buildBabelConfig(filename, options) {
  const babelRC = getBabelRC(options.projectRoots);

  const extraConfig = {
    code: false,
    filename,
  };

  let config = Object.assign({}, babelRC, extraConfig);

  // Add extra plugins
  const extraPlugins = [externalHelpersPlugin];

  var inlineRequires = options.inlineRequires;
  var blacklist = inlineRequires && inlineRequires.blacklist;
  if (inlineRequires && !(blacklist && filename in blacklist)) {
    extraPlugins.push(inlineRequiresPlugin);
  }

  config.plugins = extraPlugins.concat(config.plugins);

  if (options.hot) {
    const hmrConfig = makeHMRConfig(options, filename);
    config = Object.assign({}, config, hmrConfig);
  }

  return Object.assign({}, babelRC, config);
}
function buildBabelConfig(filename, options) {
  const babelRC = getBabelRC(options.projectRoots);

  const extraConfig = {
    code: false,
    filename,
  };

  let config = Object.assign({}, babelRC, extraConfig);

  // Add extra plugins
  const extraPlugins = [externalHelpersPlugin];

  var inlineRequires = options.inlineRequires;
  var blacklist = inlineRequires && inlineRequires.blacklist;
  if (inlineRequires && !(blacklist && filename in blacklist)) {
    extraPlugins.push(inlineRequiresPlugin);
  }

  config.plugins = extraPlugins.concat(config.plugins);

  if (options.hot) {
    const hmrConfig = makeHMRConfig(options, filename);
    config = Object.assign({}, config, hmrConfig);
  }

  return Object.assign({}, babelRC, config);
}
function buildBabelConfig ( filename , options ) { const babelRC = getBabelRC ( options . projectRoots ) ; const extraConfig = { code : false , filename , } ; let config = Object . assign ( { } , babelRC , extraConfig ) ; // Add extra plugins const extraPlugins = [ externalHelpersPlugin ] ; var inlineRequires = options . inlineRequires ; var blacklist = inlineRequires && inlineRequires . blacklist ; if ( inlineRequires && ! ( blacklist && filename in blacklist ) ) { extraPlugins . push ( inlineRequiresPlugin ) ; } config . plugins = extraPlugins . concat ( config . plugins ) ; if ( options . hot ) { const hmrConfig = makeHMRConfig ( options , filename ) ; config = Object . assign ( { } , config , hmrConfig ) ; } return Object . assign ( { } , babelRC , config ) ; }
Given a filename and options, build a Babel
config object with the appropriate plugins.
Given a filename and options build a Babel config object with the appropriate plugins .