const { resolve, basename } = require('path');
const glob = require('globby');

module.exports = (env) => {
  const entry = glob.sync('./*.js')
    .reduce((map, file) => {
      if (!/(webpack|karma)/.test(file)) {
        const fileName = basename(file, '.js');
        map[fileName] = './' + file;
      }

      return map;
    }, {});

  console.log({entry});

  const conf = {
    entry,
    mode: 'production',
    stats: 'minimal',
    output: {
      path: resolve('es5'),
      filename: '[name].js'
    },
    module: {
      rules: [
        {
          test: /\.js/,
          exclude: /node_modules/,
          use: {
            loader: 'babel-loader',
            options: {
              presets: [
                ['@babel/env', { targets: { browsers: ['IE 9'] } }]
              ]
            }
          }
        }
      ]
    }
  };

  // console.log({conf});

  return conf;
};

@@ -130,16 +130,32 @@
 sync('./
+!(webpack%7Ckarma)
 *.js')%0A 
@@ -192,113 +192,33 @@
     
-if (!/(webpack%7Ckarma)/.test(file)) %7B%0A        const fileName = basename(file, '.js');%0A        map%5BfileName
+map%5Bbasename(file, '.js')
 %5D = 
@@ -234,17 +234,8 @@
 le;%0A
-      %7D%0A%0A
     
@@ -265,33 +265,8 @@
 );%0A%0A
-  console.log(%7Bentry%7D);%0A%0A
   co
@@ -755,35 +755,8 @@
 %7D;%0A%0A
-  // console.log(%7Bconf%7D);%0A%0A
   re

Fix build