Skip to main content

Babel driver

Provides Babel support by dynamically generating a babel.config.js config file.

Requirements#

  • Babel ^7.0.0

Installation#

In your configuration module, install the driver, Babel, and any plugins or presets.

yarn add @beemo/driver-babel @babel/core @babel/preset-env

Create a file at configs/babel.ts (or js) in which to house your Babel configuration.

configs/babel.ts
import { BabelConfig } from '@beemo/driver-babel';
const config: BabelConfig = {
presets: ['@babel/preset-env'],
};
export default config;

Configuration files that return a function, and expect a Babel api instance, are currently not supported, as they conflict with Beemo's configuration functions.

Integration#

In your consuming project, enable the driver by adding babel to your drivers config.

.config/beemo.ts
import { BeemoConfig } from '@beemo/core';
const config: BeemoConfig = {
module: '<config-module>',
drivers: ['babel'],
};
export default config;