  import path from 'path';

const resolvePath = (...args) => path.resolve(path.resolve(__dirname), ...args);
const resolveClientPath = (pathName = '') => resolvePath('src', pathName);

export default (environment = 'development') => {
  const __DEV__ = environment === 'development';
  const APP_ENTRY = [resolveClientPath('index.js')];

  const webpackConfig = {
    entry: {
      app: APP_ENTRY,
    },
    output: {
      filename: '[name].js',
      path: resolvePath('dist'),
    },
    module: {
      rules: [
        {
          test: /\.js$/,
          include: [resolveClientPath()],
          use: ['babel-loader'],
        },
      ],
    },
    devtool: __DEV__ ? 'inline-source-map' : false,
    optimization: {
      namedModules: __DEV__,
      splitChunks: {
        cacheGroups: {
          appVendors: {
            name: 'vendors',
            test: /[\\/]node_modules[\\/]/,
            chunks: chunk => chunk.name === 'app',
          },
        },
      },
      runtimeChunk: {
        name: 'manifest',
      },
    },
  };

  return webpackConfig;
};

@@ -1,10 +1,8 @@
-  
 import p
@@ -174,16 +174,65 @@
 thName);
+%0Aconst APP_ENTRY = resolveClientPath('index.js');
 %0A%0Aexport
@@ -328,85 +328,17 @@
 t';%0A
-  const APP_ENTRY = %5BresolveClientPath('index.js')%5D;%0A%0A  const webpackConfig =
+%0A  return
  %7B%0A 
@@ -1025,33 +1025,8 @@
   %7D;
-%0A%0A  return webpackConfig;
 %0A%7D;%0A

Clean up Webpack config