Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
add babel specific config
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz committed Mar 3, 2021
1 parent 90cf7cd commit b07bc6d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ const config: Config = {
// optional settings for the vega-lite-dev-config
settings: {
node: true,
react: false
react: false,
babel: {
jest: true
}
}
};
```
Expand Down
15 changes: 12 additions & 3 deletions configs/babel.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
import {ConfigFile} from '@beemo/core';
import {BabelConfig} from '@beemo/driver-babel';
import {Settings} from '..';

const {tool} = process.beemo;
const {babel = {jest: true}} = (tool.config as ConfigFile<Settings>).settings;

// Used only for jest
const config: BabelConfig = {
presets: [['@babel/preset-env', {targets: {node: 'current'}}], '@babel/preset-typescript'],
};
const config: BabelConfig = babel.jest
? {
presets: [['@babel/preset-env', {targets: {node: 'current'}}], '@babel/preset-typescript'],
}
: {
// TODO
};

export default config;
10 changes: 10 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ export interface Settings {
* Support react.
*/
react?: boolean;

/**
* Babel specific configuration.
*/
babel?: {
/**
* Set up babel for Jest.
*/
jest: boolean
}
}

export type Config = BeemoConfig<Settings>;

0 comments on commit b07bc6d

Please sign in to comment.