<commit_before>const { excludeNodeModulesExcept, excludeFiles, createRegex } = require('./helpers/regex');
const { BABEL_EXCLUDE_FILES, BABEL_INCLUDE_NODE_MODULES } = require('./constants');

const UNSUPPORTED_JS_LOADER = [
    {
        loader: 'babel-loader',
        options: {
            cacheDirectory: true,
            cacheCompression: true,
            compact: true,
            presets: [
                [
                    '@babel/preset-env',
                    {
                        targets: { browsers: ['ie 11'] },
                        useBuiltIns: 'entry',
                        corejs: 3
                    }
                ]
            ],
            plugins: []
        }
    }
];

const getBabelLoader = ({ isProduction = false, hasReactRefresh = true, isTtag = false } = {}) => {
    const babelReactRefresh = hasReactRefresh ? [require.resolve('react-refresh/babel')] : [];
    const babelPluginsDev = [...babelReactRefresh];
    const babelPluginsProd = [['babel-plugin-transform-react-remove-prop-types', { removeImport: true }]];

    return {
        loader: 'babel-loader',
        options: {
            cacheDirectory: true,
            cacheCompression: isProduction,
            compact: isProduction,
            presets: [
                ['@babel/preset-typescript'],
                [
                    '@babel/preset-env',
                    {
                        targets: {
                            browsers: isProduction
                                ? ['> 0.5%, not IE 11, Firefox ESR, Safari 11']
                                : ['last 1 chrome version', 'last 1 firefox version', 'last 1 safari version']
                        },
                        useBuiltIns: 'entry',
                        corejs: 3,
                        exclude: ['transform-typeof-symbol'] // Exclude transforms that make all code slower
                    }
                ],
                [
                    '@babel/preset-react',
                    {
                        // Adds component stack to warning messages
                        // Adds __self attribute to JSX which React will use for some warnings
                        development: !isProduction
                    }
                ]
            ],<commit_msg>Fix core js version (#81)<commit_after>const { excludeNodeModulesExcept, excludeFiles, createRegex } = require('./helpers/regex');
const { BABEL_EXCLUDE_FILES, BABEL_INCLUDE_NODE_MODULES } = require('./constants');

const UNSUPPORTED_JS_LOADER = [
    {
        loader: 'babel-loader',
        options: {
            cacheDirectory: true,
            cacheCompression: true,
            compact: true,
            presets: [
                [
                    '@babel/preset-env',
                    {
                        targets: { browsers: ['ie 11'] },
                        useBuiltIns: 'entry',
                        corejs: { version: '3.12' }
                    }
                ]
            ],
            plugins: []
        }
    }
];

const getBabelLoader = ({ isProduction = false, hasReactRefresh = true, isTtag = false } = {}) => {
    const babelReactRefresh = hasReactRefresh ? [require.resolve('react-refresh/babel')] : [];
    const babelPluginsDev = [...babelReactRefresh];
    const babelPluginsProd = [['babel-plugin-transform-react-remove-prop-types', { removeImport: true }]];

    return {
        loader: 'babel-loader',
        options: {
            cacheDirectory: true,
            cacheCompression: isProduction,
            compact: isProduction,
            presets: [
                ['@babel/preset-typescript'],
                [
                    '@babel/preset-env',
                    {
                        targets: {
                            browsers: isProduction
                                ? ['> 0.5%, not IE 11, Firefox ESR, Safari 11']
                                : ['last 1 chrome version', 'last 1 firefox version', 'last 1 safari version']
                        },
                        useBuiltIns: 'entry',
                        corejs: { version: '3.12' },
                        exclude: ['transform-typeof-symbol'] // Exclude transforms that make all code slower
                    }
                ],
                [
                    '@babel/preset-react',
                    {
                        // Adds component stack to warning messages
                        // Adds __self attribute to JSX which React will use for some warnings
                        development: !isProduction
                    }
                ]
            ],
{'fraction_non_alphanumeric': 0.10180800688764528, 'fraction_numerical': 0.006887645286267757, 'mean_word_length': 1.1725105189340814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '801176', 'n_tokens_mistral': 1200, 'n_tokens_neox': 1086, 'n_words': 248}