{"size": 439, "ext": "js", "max_stars_repo_path": "packages/tm-shared/templates/react-typescript-webpack/webpack.config.js", "max_stars_repo_name": "jameslahm/tm-cli", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "packages/tm-shared/templates/react-typescript-webpack/webpack.config.js", "max_issues_repo_name": "jameslahm/tm-cli", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "packages/tm-shared/templates/react-typescript-webpack/webpack.config.js", "max_forks_repo_name": "jameslahm/tm-cli", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.3571428571, "max_line_length": 79, "alphanum_fraction": 0.6651480638}
const webpackMerge = require('webpack-merge');

module.exports = ({ mode, presets = [] }) => {
  process.env.NODE_ENV = mode;
  if (!Array.isArray(presets)) {
    presets = [presets];
  }
  const base = require('./build/webpack.base.js');
  const modeConfig = require(`./build/webpack.${mode}.js`);
  const presetsConfig = require(`./build/loadPresets`);

  return webpackMerge(base(mode), modeConfig(mode), ...presetsConfig(presets));
};
