# Type alias BabelOptions

BabelOptions: {
enableFlow?: boolean | {
requireDirective: boolean;
};
enableTypeScript?: boolean;
excludeRegExp?: RegExp[];
includeRegExp?: RegExp[];
proposalDecorators?: boolean | {
legacy: boolean;
};
transformClassProps?: boolean | {
loose: boolean;
};
}

configurable options related to transpiler (babel)

#### Type declaration

- ##### `Optional` enableFlow?: boolean | {
  requireDirective: boolean;
  }

  Enable support for stripping flow.js types using `@babel/plugin-transform-flow-strip-types`

  "@remarks" transpile only, no type checking

  - Default: `false`
  - if not set, then we check env `ENABLE_BABEL_FLOW`

  requireDirective behavior (defaulted to NOT required):

  - When this plugin is enabled, it's defaulted to not require the `@flow` directive in source.
  - To change this behavior, set this option to `{ requireDirective: true }`

- ##### `Optional` enableTypeScript?: boolean

  enable support for typescript types using `@babel/preset-typescript`

  "@remarks" transpile only, no type checking

  - Default: true
  - if not set, then we check env `ENABLE_BABEL_TYPESCRIPT`

- ##### `Optional` excludeRegExp?: RegExp[]

  List of RegExp to match files that should not be transpiled by babel.

  This is checked after includeRegExp

- ##### `Optional` includeRegExp?: RegExp[]

  List of RegExp to match files that should be included for transpiling.

  By default, files under node_modules are not transpiled.

  You can set this to control that. ie: to compile everything under node_modules, use `[/node_modules/]`

- ##### `Optional` proposalDecorators?: boolean | {
  legacy: boolean;
  }

  Add `@babel/plugin-proposal-decorators`

  - Default: `false`
  - if not set, then we check env `BABEL_PROPOSAL_DECORATORS`

  legacyDecorators behavior (default to enabled):

  - When this plugin is enabled, it's defaulted to legacy decorators behavior.
  - To change this behavior, set this option to `{ legacy: false }`

- ##### `Optional` transformClassProps?: boolean | {
  loose: boolean;
  }

  Add `@babel/plugin-proposal-class-properties` for class properties support

  - Default: `false`
  - if not set, then we check env `BABEL_CLASS_PROPS`

  looseClassProps behavior (default to enabled):

  - When this plugin is enabled, it's defaulted to loose class props setting, which compile to assignment expression instead of `Object.defineProperty`
  - To change loose class props behavior, set this option to `{ loose: false }`,

- Defined in packages/xarc-app-dev/src/config/opt2/babel-options.ts:6