{"size": 1336, "ext": "js", "max_stars_repo_path": "webextension-toolbox-config.js", "max_stars_repo_name": "turkdevops/nexus-iq-chrome-extension", "max_stars_repo_stars_event_min_datetime": "2021-02-21T14:05:24.000Z", "max_stars_repo_stars_event_max_datetime": "2021-02-21T14:05:24.000Z", "max_issues_repo_path": "webextension-toolbox-config.js", "max_issues_repo_name": "turkdevops/nexus-iq-chrome-extension", "max_issues_repo_issues_event_min_datetime": "2021-02-21T05:23:37.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-25T21:49:04.000Z", "max_forks_repo_path": "webextension-toolbox-config.js", "max_forks_repo_name": "turkdevops/nexus-iq-chrome-extension", "max_forks_repo_forks_event_min_datetime": "2021-01-21T12:05:07.000Z", "max_forks_repo_forks_event_max_datetime": "2021-01-21T12:05:07.000Z"}
{"max_stars_count": 1, "max_issues_count": 120, "max_forks_count": 1, "avg_line_length": 30.3636363636, "max_line_length": 73, "alphanum_fraction": 0.5883233533}
const path = require("path");
const GlobEntriesPlugin = require("webpack-watched-glob-entries-plugin");
// const BundleAnalyzerPlugin = require("webpack-bundle-analyzer")
//   .BundleAnalyzerPlugin;
// const ProvidePlugin = require("webpack-provide-plugin");

module.exports = {
  webpack: (config, { dev, vendor }) => {
    const envName = dev ? "development" : "production";
    config.devtool = "eval";
    config.module = config.module || { rules: [] };
    config.module.rules.push({
      enforce: "pre",
      test: /\.js$/,
      use: ["source-map-loader"],
    });
    config.resolve.extensions.push(".ts");
    config.resolve.extensions.push(".tsx");
    config.entry = GlobEntriesPlugin.getEntries([
      path.resolve("src", "*.{js,mjs,jsx,ts,tsx}"),
      path.resolve("src", "?(scripts)/*.{js,mjs,jsx,ts,tsx}"),
    ]);
    config.module.rules.push({
      test: /\.tsx?$/,
      exclude: path.resolve("src", "./scripts/lib"),
      use: [
        {
          loader: "ts-loader",
        },
      ],
    });
    config.optimization.splitChunks = {
      name: "scripts/vendor",
      chunks: "initial",
    };
    config.output.chunkFilename = "[name].js";
    // Disable minimize for vendor review
    config.optimization.minimize = false;

    return config;
  },
  copyIgnore: ["**/*.ts", "**/*.json", "**/*.tsx"],
};
