const webpack = require('webpack');
const prodConfig = require('./webpack.web.prod.js');

prodConfig.plugins.forEach((plugin) => {
  if (plugin instanceof webpack.DefinePlugin) {
    plugin.definitions['process.env.historyType'] = JSON.stringify('HASH');
  }
});

const config = Object.assign({}, prodConfig, {
  mode: 'development',
  watch: true,
  devServer: {
    compress: true,
    hot: true,
    liveReload: true,
    port: 9001,
  },
});

module.exports = config;
