MCPcopy Index your code
hub / github.com/react/react / getBabelConfig

Function getBabelConfig

scripts/rollup/build.js:143–172  ·  view source on GitHub ↗
(
  updateBabelOptions,
  bundleType,
  packageName,
  isDevelopment,
  bundle
)

Source from the content-addressed store, hash-verified

141];
142
143function getBabelConfig(
144 updateBabelOptions,
145 bundleType,
146 packageName,
147 isDevelopment,
148 bundle
149) {
150 let options = {
151 exclude: '/**/node_modules/**',
152 babelrc: false,
153 configFile: false,
154 presets: [],
155 plugins: [...babelPlugins],
156 babelHelpers: 'bundled',
157 sourcemap: false,
158 };
159 if (isDevelopment) {
160 options.plugins.push(...babelToES5Plugins);
161 }
162 if (updateBabelOptions) {
163 options = updateBabelOptions(options);
164 }
165 // Controls whether to replace error messages with error codes in production.
166 // By default, error messages are replaced in production.
167 if (!isDevelopment && bundle.minifyWithProdErrorCodes !== false) {
168 options.plugins.push(require('../error-codes/transform-error-messages'));
169 }
170
171 return options;
172}
173
174let getRollupInteropValue = id => {
175 // We're setting Rollup to assume that imports are ES modules unless otherwise specified.

Callers 1

getPluginsFunction · 0.85

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected