Socket
Book a DemoInstallSign in
Socket

@foxford/babel-preset-react-app

Package Overview
Dependencies
Maintainers
6
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@foxford/babel-preset-react-app

Preset babel for foxford js apps

1.7.0
latest
Source
npmnpm
Version published
Weekly downloads
83
53.7%
Maintainers
6
Weekly downloads
 
Created
Source

Build Status

Babel preset for foxford js apps

Forked from babel-preset-react-app v10.0.0

First, install Babel.

Then install @foxford/babel-preset-react-app.

pnpm add @foxford/babel-preset-react-app --save-dev

Then create a file named .babelrc with following contents in the root folder of your project:

{
  "presets": ["@foxford/babel-preset-react-app"]
}

This preset uses the useBuiltIns option with transform-object-rest-spread and transform-react-jsx, which assumes that Object.assign is available or polyfilled.

Usage with Flow

Make sure you have a .flowconfig file at the root directory. You can also use the flow option on .babelrc:

{
  "presets": [["@foxford/babel-preset-react-app", { "flow": true, "typescript": false }]]
}

Usage with TypeScript

Make sure you have a tsconfig.json file at the root directory. You can also use the typescript option on .babelrc:

{
  "presets": [["@foxford/babel-preset-react-app", { "flow": false, "typescript": true }]]
}

Absolute Runtime Paths

Absolute paths are enabled by default for imports. To use relative paths instead, set the absoluteRuntime option in .babelrc to false:

{
  "presets": [["@foxford/babel-preset-react-app", { "absoluteRuntime": false }]]
}

Options

type PresetOptions {
  absoluteRuntime: boolean,
  flow: boolean,
  typescript: boolean,
  debug: boolean,
  envUseBuiltIns: 'entry' | 'usage',
  presetEnvDisabled: boolean, // disable preset-env plugin
  targets: {}, // preset-env targets
  mjs: boolean, // esmodules targets for preset-env
  useESModules: boolean, // https://babeljs.io/docs/en/babel-plugin-transform-runtime#useesmodules
  runtime: 'classic' | 'automatic' // use new jsx transform
}

Plugins

  "@babel/plugin-proposal-class-properties"
  "@babel/plugin-proposal-decorators"
  "@babel/plugin-proposal-nullish-coalescing-operator"
  "@babel/plugin-proposal-numeric-separator"
  "@babel/plugin-proposal-optional-chaining"
  "@babel/plugin-transform-flow-strip-types"
  "@babel/plugin-transform-react-display-name"
  "@babel/plugin-proposal-export-default-from"
  "@babel/plugin-transform-runtime"

Keywords

babel

FAQs

Package last updated on 25 Mar 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.