{"size": 1221, "ext": "js", "max_stars_repo_path": "template/build/webpack.dev.conf.js", "max_stars_repo_name": "VanMess/vue-iview-template", "max_stars_repo_stars_event_min_datetime": "2017-11-04T16:34:38.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-09T15:20:32.000Z", "max_issues_repo_path": "template/build/webpack.dev.conf.js", "max_issues_repo_name": "VanMess/vue-iview-template", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "template/build/webpack.dev.conf.js", "max_forks_repo_name": "VanMess/vue-iview-template", "max_forks_repo_forks_event_min_datetime": "2018-11-08T07:45:10.000Z", "max_forks_repo_forks_event_max_datetime": "2021-12-09T15:20:20.000Z"}
{"max_stars_count": 7, "max_issues_count": null, "max_forks_count": 6, "avg_line_length": 32.1315789474, "max_line_length": 95, "alphanum_fraction": 0.7100737101}
import webpack from 'webpack';
import merge from 'webpack-merge';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import FriendlyErrorsPlugin from 'friendly-errors-webpack-plugin';
import config from '../config';
import baseWebpackConfig from './webpack.base.conf';
import { styleLoaders } from './utils';

// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach((name) => {
  baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name]);
});

export default merge(baseWebpackConfig, {
  module: {
    rules: styleLoaders({
      sourceMap: config.dev.cssSourceMap
    })
  },
  // cheap-module-eval-source-map is faster for development
  devtool: '#cheap-module-eval-source-map',
  plugins: [
    new webpack.DefinePlugin({
      'process.env': config.dev.env
    }),
    // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoEmitOnErrorsPlugin(),
    // https://github.com/ampedandwired/html-webpack-plugin
    new HtmlWebpackPlugin({
      filename: 'index.html',
      template: 'index.html',
      inject: true
    }),
    new FriendlyErrorsPlugin()
  ]
});
