<commit_before>import { RuleSetRule } from 'webpack';
import { plugins } from './babel';

export const es6Transpiler: () => RuleSetRule = () => {
  // TODO: generate regexp using are-you-es5

  const include = /[\\/]node_modules[\\/](@storybook\/node-logger|are-you-es5|better-opn|boxen|chalk|commander|find-cache-dir|find-up|fs-extra|json5|node-fetch|pkg-dir|resolve-from|semver)/;
  return {
    test: /\.js$/,
    use: [
      {
        loader: require.resolve('babel-loader'),
        options: {
          sourceType: 'unambiguous',
          presets: [
            [
              require.resolve('@babel/preset-env'),
              { shippedProposals: true, useBuiltIns: 'usage', corejs: '3' },
            ],
            require.resolve('@babel/preset-react'),
          ],
          plugins,
        },
      },
    ],
    include,<commit_msg>remove preset-env preset options conflicting with the new babel plugin to add core-js dependecies<commit_after>import { RuleSetRule } from 'webpack';
import { plugins } from './babel';

export const es6Transpiler: () => RuleSetRule = () => {
  // TODO: generate regexp using are-you-es5

  const include = /[\\/]node_modules[\\/](@storybook\/node-logger|are-you-es5|better-opn|boxen|chalk|commander|find-cache-dir|find-up|fs-extra|json5|node-fetch|pkg-dir|resolve-from|semver)/;
  return {
    test: /\.js$/,
    use: [
      {
        loader: require.resolve('babel-loader'),
        options: {
          sourceType: 'unambiguous',
          presets: [
            [require.resolve('@babel/preset-env'), { shippedProposals: true }],
            require.resolve('@babel/preset-react'),
          ],
          plugins,
        },
      },
    ],
    include,
{'fraction_non_alphanumeric': 0.164519906323185, 'fraction_numerical': 0.005269320843091335, 'mean_word_length': 2.390873015873016, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4430302', 'n_tokens_mistral': 562, 'n_tokens_neox': 544, 'n_words': 88}