Home / Function/ getBabelConfig() — react Function Reference

getBabelConfig() — react Function Reference

Architecture documentation for the getBabelConfig() function in build.js from the react codebase.

Entity Profile

Dependency Diagram

graph TD
  7bbc1c59_9f57_47d3_8dcc_d34af876428a["getBabelConfig()"]
  c80a1a72_0983_3915_42ad_1026a11c0a09["build.js"]
  7bbc1c59_9f57_47d3_8dcc_d34af876428a -->|defined in| c80a1a72_0983_3915_42ad_1026a11c0a09
  67c68ebd_67d3_ae9b_4fd2_ce22eb678392["getPlugins()"]
  67c68ebd_67d3_ae9b_4fd2_ce22eb678392 -->|calls| 7bbc1c59_9f57_47d3_8dcc_d34af876428a
  style 7bbc1c59_9f57_47d3_8dcc_d34af876428a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

scripts/rollup/build.js lines 143–172

function getBabelConfig(
  updateBabelOptions,
  bundleType,
  packageName,
  isDevelopment,
  bundle
) {
  let options = {
    exclude: '/**/node_modules/**',
    babelrc: false,
    configFile: false,
    presets: [],
    plugins: [...babelPlugins],
    babelHelpers: 'bundled',
    sourcemap: false,
  };
  if (isDevelopment) {
    options.plugins.push(...babelToES5Plugins);
  }
  if (updateBabelOptions) {
    options = updateBabelOptions(options);
  }
  // Controls whether to replace error messages with error codes in production.
  // By default, error messages are replaced in production.
  if (!isDevelopment && bundle.minifyWithProdErrorCodes !== false) {
    options.plugins.push(require('../error-codes/transform-error-messages'));
  }

  return options;
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does getBabelConfig() do?
getBabelConfig() is a function in the react codebase, defined in scripts/rollup/build.js.
Where is getBabelConfig() defined?
getBabelConfig() is defined in scripts/rollup/build.js at line 143.
What calls getBabelConfig()?
getBabelConfig() is called by 1 function(s): getPlugins.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free