{"size": 932, "ext": "js", "max_stars_repo_path": "example/build/common/modules.js", "max_stars_repo_name": "denis-mludek/kaiju", "max_stars_repo_stars_event_min_datetime": "2016-08-25T10:06:41.000Z", "max_stars_repo_stars_event_max_datetime": "2022-02-06T21:14:39.000Z", "max_issues_repo_path": "example/build/common/modules.js", "max_issues_repo_name": "denis-mludek/kaiju", "max_issues_repo_issues_event_min_datetime": "2016-10-30T10:46:22.000Z", "max_issues_repo_issues_event_max_datetime": "2018-06-15T07:08:37.000Z", "max_forks_repo_path": "example/build/common/modules.js", "max_forks_repo_name": "denis-mludek/kaiju", "max_forks_repo_forks_event_min_datetime": "2016-09-21T15:17:22.000Z", "max_forks_repo_forks_event_max_datetime": "2020-11-03T07:47:36.000Z"}
{"max_stars_count": 90, "max_issues_count": 10, "max_forks_count": 17, "avg_line_length": 32.1379310345, "max_line_length": 119, "alphanum_fraction": 0.6545064378}
const path = require('path')
const ExtractTextPlugin = require('extract-text-webpack-plugin')

const extractLess = ExtractTextPlugin.extract({
  fallback: 'style-loader',
  use: [
    { loader: 'css-loader', query: { modules: true, localIdentName: '[local]-[hash:base64:5]' } },
    { loader: 'less-loader' }
  ]
})

const tsconfig = path.resolve(__dirname, '../../tsconfig.json')
const tslintConfig = path.resolve(__dirname, '../tslint.json')

module.exports = ({ isProd }) => {
  const tsOptions = {
    configFile: tslintConfig,
    emitErrors: isProd,
    failOnHint: isProd
  }

  const tsLinter    = { test: /\.ts$/, enforce: 'pre', loader: 'tslint-loader', options: tsOptions }
  const tsLoader    = { test: /\.ts$/, loader: 'ts-loader', options: { configFile: tsconfig, transpileOnly: !isProd } }
  const styleLoader = { test: /\.less$/, loader: extractLess }

  return {
    rules: [ tsLinter, tsLoader, styleLoader ]
  }
}