{"size": 1054, "ext": "js", "max_stars_repo_path": "test/webpack.config.js", "max_stars_repo_name": "yibn2008/fast-css-loader", "max_stars_repo_stars_event_min_datetime": "2018-05-07T07:14:49.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-14T01:39:39.000Z", "max_issues_repo_path": "test/webpack.config.js", "max_issues_repo_name": "yibn2008/fast-css-loader", "max_issues_repo_issues_event_min_datetime": "2018-06-28T11:05:20.000Z", "max_issues_repo_issues_event_max_datetime": "2019-11-03T06:05:53.000Z", "max_forks_repo_path": "test/webpack.config.js", "max_forks_repo_name": "yibn2008/fast-css-loader", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 19, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 21.9583333333, "max_line_length": 85, "alphanum_fraction": 0.4573055028}
'use strict'

const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')

module.exports = function (basedir, isFast) {
  return {
    devtool: false,
    mode: 'development',
    entry: {
      'index': path.join(basedir, 'src/index.css')
    },
    output: {
      publicPath: './',
      path: path.join(basedir, isFast ? 'actual' : 'expect'),
      filename: '[name].js'
    },
    module: {
      rules: [
        {
          test: /\.(svg|bmp|gif|png|jpe?g)$/,
          loader: require.resolve('file-loader'),
          options: {
            name: '[name].[hash:8].[ext]'
          }
        },
        {
          test: /\.css$/,
          use: [
            MiniCssExtractPlugin.loader,
            {
              loader: isFast ? require.resolve('..') : require.resolve('css-loader'),
              options: {
                import: true
              }
            }
          ]
        },
      ]
    },
    plugins: [
      new MiniCssExtractPlugin({
        filename: '[name].css'
      }),
    ]
  }
}
