{"size": 1166, "ext": "js", "max_stars_repo_path": "svr/domain/webpack.config.js", "max_stars_repo_name": "psowinski/rias", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "svr/domain/webpack.config.js", "max_issues_repo_name": "psowinski/rias", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "svr/domain/webpack.config.js", "max_forks_repo_name": "psowinski/rias", "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": 24.2916666667, "max_line_length": 73, "alphanum_fraction": 0.5454545455}
/* eslint-disable */
var path = require('path');
var nodeExternals = require('webpack-node-externals');
var cleanPlugin = require('clean-webpack-plugin');

function resolve(filePath) {
  return path.join(__dirname, filePath);
}

var isProduction = process.argv.indexOf('-p') >= 0;
console.log(
  'Bundling for ' + (isProduction ? 'production' : 'development') + '...'
);

module.exports = env => {
  return {
    mode: isProduction ? 'production' : 'development',
    devtool: 'source-map',
    entry: resolve('./src/index.js'),
    target: 'node',
    externals: [nodeExternals()],
    output: {
      filename: 'bundle.js',
      path: resolve('./dist'),
      library: 'lib',
      libraryTarget: 'commonjs2'
    },
    plugins: [new cleanPlugin()],
    resolve: {
      modules: ['node_modules', resolve('./node_modules/')],
      extensions: ['*', '.mjs', '.js', '.json']
    },
    module: {
      rules: [
        {
          test: /\.m?js$/,
          type: 'javascript/auto',
          exclude: /node_modules/,
          use: {
            loader: 'babel-loader',
            options: { presets: ['@babel/env'] }
          }
        }
      ]
    }
  };
};
