const { merge } = require('webpack-merge')

const baseConfig = require('./base')
const devServer = require('../dev_server')
const { runningWebpackDevServer } = require('../env')

const { outputPath: contentBase, publicPath } = require('../config')

let devConfig = {
  mode: 'development',
  devtool: 'cheap-module-source-map'
}

if (runningWebpackDevServer) {
  let liveReload = !devServer.hmr
  if (devServer.live_reload !== undefined) {
    liveReload = devServer.live_reload
  }

  const devServerConfig = {
    devMiddleware: {
      publicPath
    },
    compress: devServer.compress,
    allowedHosts: devServer.allowed_hosts,
    host: devServer.host,
    port: devServer.port,
    https: devServer.https,
    hot: devServer.hmr,
    liveReload,
    historyApiFallback: { disableDotRule: true },
    headers: devServer.headers,
    static: {
      publicPath: contentBase
    }
  }

  if (devServer.static) {
    devServerConfig.static = { ...devServerConfig.static, ...devServer.static }
  }

  if (devServer.client) {
    devServerConfig.client = devServer.client
  }

  devConfig = merge(devConfig, {
    stats: {
      colors: true,
      entrypoints: false,
      errorDetails: true,
      modules: false,
      moduleTrace: false
    },
    devServer: devServerConfig
  })
}

module.exports = merge(baseConfig, devConfig)

@@ -356,18 +356,20 @@
 er) %7B%0A  
-le
+cons
 t liveRe
@@ -379,29 +379,8 @@
 d = 
-!devServer.hmr%0A  if (
 devS
@@ -414,28 +414,10 @@
 ined
-) %7B%0A    liveReload =
+ ?
  dev
@@ -434,20 +434,33 @@
 e_reload
-%0A  %7D
+ : !devServer.hmr
 %0A%0A  cons

Use a const and a ternary, rather than mutate