<commit_before>/* @flow */
import path from "path";
import ExtractTextPlugin from "extract-text-webpack-plugin";
import autoprefixer from "autoprefixer";
import precss from "precss";
import postcssPartialImport from "postcss-partial-import";

/**
 * Creates loader for JavaScript files and add some extra features for dev server, like hot reloading.
 */
export function createJSLoader(flags: CLIFlags, isProd: boolean): any[] {
  const presets = [
    require.resolve("babel-preset-react"),
    [
      require.resolve("babel-preset-env"),
      {
        targets: { ie: 11 }
      }
    ]
  ];

  if (flags.react && !isProd) {
    presets.push(require.resolve("babel-preset-react-hmre"));
  }

  const jsLoaders: { loader: string, query?: any }[] = [
    {
      loader: require.resolve("babel-loader"),
      query: { presets }
    }
  ];
<commit_msg>feat: Add tree shaking support<commit_after>/* @flow */
import path from "path";
import ExtractTextPlugin from "extract-text-webpack-plugin";
import autoprefixer from "autoprefixer";
import precss from "precss";
import postcssPartialImport from "postcss-partial-import";

/**
 * Creates loader for JavaScript files and add some extra features for dev server, like hot reloading.
 */
export function createJSLoader(flags: CLIFlags, isProd: boolean): any[] {
  const presets = [
    require.resolve("babel-preset-react"),
    [
      require.resolve("babel-preset-env"),
      {
        targets: { ie: 11 },
        modules: false
      }
    ]
  ];

  if (flags.react && !isProd) {
    presets.push(require.resolve("babel-preset-react-hmre"));
  }

  const jsLoaders: { loader: string, query?: any }[] = [
    {
      loader: require.resolve("babel-loader"),
      query: { presets }
    }
  ];

{'fraction_non_alphanumeric': 0.13795077275329135, 'fraction_numerical': 0.0022896393817973667, 'mean_word_length': 3.3160493827160495, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1961269', 'n_tokens_mistral': 555, 'n_tokens_neox': 546, 'n_words': 138}