How to use babel-preset-react-app - 1 common examples

To help you get started, we’ve selected a few babel-preset-react-app 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 strothj / react-app-rewire-typescript-babel-preset / packages / rewire / rewirePreset.ts View on Github external
const removeFlowPreset = (...args: any[]) => {
  // Pass along arguments to babel-preset-react-app and generate its preset.
  const preset = presetReactApp(...args);

  // Remove the Flow preset.
  preset.presets = preset.presets.filter(
    p => !babelPluginTransformFlowDetectionHack(p)
  );

  // Add the TypeScript preset if we have a compatible Babel beta version, see
  // the docs for "doesBabelSupportOverridesFeature".
  const overridesSupported = doesBabelSupportOverridesFeature(args[0].version);
  if (overridesSupported) {
    preset.presets.push(presetTypeScript);
  } else {
    preset.presets.push({
      plugins: [transformTypeScript]
    });
  }

babel-preset-react-app

Babel preset used by Create React App

MIT
Latest version published 3 years ago

Package Health Score

88 / 100
Full package analysis

Popular babel-preset-react-app functions