{"size": 1189, "ext": "js", "max_stars_repo_path": "webpack.config.js", "max_stars_repo_name": "aethelz/ballistgraph", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "webpack.config.js", "max_issues_repo_name": "aethelz/ballistgraph", "max_issues_repo_issues_event_min_datetime": "2021-03-08T23:56:22.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-08T00:22:51.000Z", "max_forks_repo_path": "webpack.config.js", "max_forks_repo_name": "aethelz/ballistgraph", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 22.4339622642, "max_line_length": 78, "alphanum_fraction": 0.4987384357}
const path = require('path');
const CleanWebpackPlugin = require('clean-webpack-plugin');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const TerserPlugin = require('terser-webpack-plugin');

module.exports = {
  mode: 'production',
  entry: './app.js',
  output: {
    filename: 'bundle.js',
    path: path.resolve(__dirname, 'public'),
  },
  plugins: [
    new MiniCssExtractPlugin({}),
    new CleanWebpackPlugin(['public']),
  ],
  optimization: {
    minimizer: [
      new TerserPlugin(),
      new OptimizeCSSAssetsPlugin({}),
    ]
  },
  module: {
    rules: [
      {
        test: /\.js$/,
        exclude: /node_modules/,
        use: {
          loader: 'babel-loader',
          options: {
            'presets': [
              [
                '@babel/preset-env', {
                  'targets': '> 0.25%, not dead',
                },
              ],
            ],
          },
        },
      },
      {
        test: /\.css$/,
        use: [
          MiniCssExtractPlugin.loader,
          // 'style-loader',
          'css-loader',
        ]
      },
    ],
  },
}
