babel-preset-jaid
Version:
These are my personal Babel presets. They aim for minimizing boilerplate for projects that need Babel.
28 lines • 1.75 kB
TypeScript
declare module "babel-preset-jaid" {
/**
* @property [react = false] - If `true` or typeof `string`, `react`-related plugins and presets are included. If `react-, `react-dom`-related plugins and presets are also included.
* @property [runtime = true] - If `true`, `@babel/plugin-transform-runtime` will be applied.
* @property [minify = true] - If `false`, `babel-minify` won't be applied to production builds. If `true`, `babel-fy` will be applied with `{removeConsole: false, removeDebugger: true}` as configuration. If typeof `object`, this will bed as `babel-minify` config.
* @property [envOptions = null] - If typeof `object`, this will be used as options for `@babel/preset-env`.
* @property [flow = false] - If `true`, support Facebook Flow.
* @property [typescript = false] - If `true`, support Microsoft TypeScript.
* @property [aotLoader = true] - If `true`, `aot-loader/babel` will be applied
* @property [legacyDecorators = true] - If `true`, `plugin-proposal-decorators` will have `lecacy: true` and `plugin-proposal-class-properties` will have `loose: true`
* @property [outputConfig = false] - If `true`, the generated Babel config will be written to `./dist/babel-preset-jaid/config.json` (can be also activated with environment variable outputBabelPresetJaid=1)
*/
export type options = {
react?: boolean;
runtime?: boolean;
minify?: boolean | any;
envOptions?: any;
flow?: boolean;
typescript?: boolean;
aotLoader?: boolean;
legacyDecorators?: boolean;
outputConfig?: boolean;
};
/**
* @param api - Babel api instance
*/
export default function(api: any, options: options): void;
}