<commit_before>"use strict";
/*eslint filenames/match-exported: off*/

const path = require("path");
const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin")

const getPath = (fullPath) => {
  const args = fullPath.split("/");
  args.unshift(__dirname);
  return path.resolve(...args);
};

const svgoConfig = {};

let config = {
  context: getPath("public"),
  entry: [ "./main" ],
  output: {
    path: getPath("dist"),
    filename: "main.js",
  },
  plugins: [
    new HtmlWebpackPlugin({
      hash: true,
      template: getPath("public/index.ejs"),
    }),
    new webpack.DefinePlugin({
      "process.env": {
        NODE_ENV: JSON.stringify(process.env.NODE_ENV || ""),
      },
      "__DEV__": process.env.NODE_ENV !== "production",
    }),
  ],
  module: {
    loaders: [
      {
        test: /\.js$/,
        loader: "babel-loader",
        query: {
          babelrc: false,
          presets: ["es2015", "stage-0"],
        },
      },
      {
        test: /\.svg$/,
        loaders: [
          "file-loader?name=[path][name].[ext]?[hash]",
          "svgo-loader?" + JSON.stringify(svgoConfig),
        ],
      },
      {
        test: /\.png$/,
        loader: "file-loader?name=[path][name].[ext]?[hash]",
      },
    ],
  },
};

if (process.env.NODE_ENV === "production" || process.env.NODE_ENV === "demo") {
  config.plugins.push(
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false,<commit_msg>don't run babel on node_modules<commit_after>"use strict";
/*eslint filenames/match-exported: off*/

const path = require("path");
const webpack = require("webpack");
const HtmlWebpackPlugin = require("html-webpack-plugin")

const getPath = (fullPath) => {
  const args = fullPath.split("/");
  args.unshift(__dirname);
  return path.resolve(...args);
};

const svgoConfig = {};

let config = {
  context: getPath("public"),
  entry: [ "./main" ],
  output: {
    path: getPath("dist"),
    filename: "main.js",
  },
  plugins: [
    new HtmlWebpackPlugin({
      hash: true,
      template: getPath("public/index.ejs"),
    }),
    new webpack.DefinePlugin({
      "process.env": {
        NODE_ENV: JSON.stringify(process.env.NODE_ENV || ""),
      },
      "__DEV__": process.env.NODE_ENV !== "production",
    }),
  ],
  module: {
    loaders: [
      {
        include(path) {
          return !path.includes("/node_modules/") || path.includes("/node_modules/sans-sel/");
        },
        test: /\.js$/,
        loader: "babel-loader",
        query: {
          babelrc: false,
          presets: ["es2015", "stage-0"],
        },
      },
      {
        test: /\.svg$/,
        loaders: [
          "file-loader?name=[path][name].[ext]?[hash]",
          "svgo-loader?" + JSON.stringify(svgoConfig),
        ],
      },
      {
        test: /\.png$/,
        loader: "file-loader?name=[path][name].[ext]?[hash]",
      },
    ],
  },
};

if (process.env.NODE_ENV === "production" || process.env.NODE_ENV === "demo") {
  config.plugins.push(
    new webpack.optimize.OccurenceOrderPlugin(),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false,
{'fraction_non_alphanumeric': 0.18808193668528864, 'fraction_numerical': 0.0031036623215394167, 'mean_word_length': 2.3713389121338913, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 5, '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': '7512521', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1064, 'n_words': 179}