{"size": 1052, "ext": "js", "max_stars_repo_path": "webpack.config.js", "max_stars_repo_name": "octopusthink/captain-hooks", "max_stars_repo_stars_event_min_datetime": "2021-09-01T06:53:48.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-01T06:53:48.000Z", "max_issues_repo_path": "webpack.config.js", "max_issues_repo_name": "octopusthink/captain-hooks", "max_issues_repo_issues_event_min_datetime": "2021-09-01T18:44:33.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-22T08:05:01.000Z", "max_forks_repo_path": "webpack.config.js", "max_forks_repo_name": "octopusthink/captain-hooks", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 23.3777777778, "max_line_length": 85, "alphanum_fraction": 0.5608365019}
const fs = require('fs');
const path = require('path');

const PeerDepsExternalsPlugin = require('peer-deps-externals-webpack-plugin');

const projectPath = path.resolve(fs.realpathSync(process.cwd()), '.');
const packagesPath = path.resolve(fs.realpathSync(process.cwd()), 'packages');

const config = {
  mode: process.env.NODE_ENV,
  module: {
    rules: [
      // Transform ES6 with Babel
      {
        test: /\.(js|jsx|mjs)$/,
        include: [projectPath],
        use: [
          {
            loader: require.resolve('babel-loader'),
            options: {
              babelrc: true,
              cacheDirectory: true,
              presets: [],
            },
          },
        ],
      },
    ],
  },
  optimization: {
    minimize: false,
  },
  plugins: [],
  resolve: {
    modules: ['node_modules'],
    extensions: ['.mjs', '.jsx', '.js', '.json'],
  },
};

if (process.env.NODE_ENV === 'production' && !process.env.DISABLE_PEER_DEPS_PLUGIN) {
  config.plugins.push(new PeerDepsExternalsPlugin());
}

module.exports = config;
