{"size": 958, "ext": "js", "max_stars_repo_path": "pug_stylus_webpack/webpack.config.js", "max_stars_repo_name": "linnil1/nyadoi_oh_so_cute", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "pug_stylus_webpack/webpack.config.js", "max_issues_repo_name": "linnil1/nyadoi_oh_so_cute", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "pug_stylus_webpack/webpack.config.js", "max_forks_repo_name": "linnil1/nyadoi_oh_so_cute", "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": 18.7843137255, "max_line_length": 57, "alphanum_fraction": 0.4206680585}
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');


module.exports = (env, argv) => {
  var entry = {}
  if (argv.mode == "development")
    entry = {
      'tmp': [  // Put this because hot-reload
        './src/index.pug',
        './src/index.styl',
      ] 
    }

  return {
    entry: entry,
    output: {
      path: path.resolve(__dirname, 'dist'),
    },
    devServer: {
      port: 5000,
    },
    plugins: [
      new HtmlWebpackPlugin({
        template: './src/index.pug',
        inject: true,
      }),
    ],
    module: {
      rules: [
        {
          test: /\.pug$/,
          use: ['pug-loader']
        },
        {
          test: /\.styl$/,
          use: [
            // "style-loader",
            "css-loader",
            "stylus-loader",
          ],
        },
        {
          test: /\.(png|svg|jpg|jpeg|gif|webp)$/i,
          use: ['file-loader']
        },
      ]
    }
  }
}
