export const DEFAULT_PRESETS = [
    'react',
];
export const DEFAULT_PLUGINS = [];
export const PRODUCTION_CONFIG = {
    presets: DEFAULT_PRESETS,
    plugins: [
        ...DEFAULT_PLUGINS,
    ],
    minified: true,
    comments: false
};
export const DEVELOPMENT_CONFIG = {
    presets: DEFAULT_PRESETS,
    plugins: [
        ...DEFAULT_PLUGINS,
    ],
    sourceMaps: 'inline',
    minified: false,
    comments: true
};
export function getBabelConfig(production = false) {
    return production ? PRODUCTION_CONFIG : DEVELOPMENT_CONFIG;
}
export function validateBabelPresets(babel) {
    if (!babel || !babel.availablePresets) {
        return false;
    }
    return 'react' in babel.availablePresets;
}
export const JSX_PRAGMAS = {
    classic: {
        pragma: 'React.createElement',
        pragmaFrag: 'React.Fragment'
    },
    automatic: {
        runtime: 'automatic',
        importSource: 'react'
    }
};
export function getJSXConfig(reactVersion) {
    if (reactVersion && parseInt(reactVersion.split('.')[0]) >= 17) {
        return JSX_PRAGMAS.automatic;
    }
    return JSX_PRAGMAS.classic;
}
//# sourceMappingURL=babel-config.js.map