text: const path = require("path");
  const webpack = require("webpack");
  const nodeExternals = require("webpack-node-externals");
  
  /*
   * SplitChunksPlugin is enabled by default and replaced
   * deprecated CommonsChunkPlugin. It automatically identifies modules which
   * should be splitted of chunk by heuristics using module duplication count and
   * module category (i. e. node_modules). And splits the chunks…
   *
   * It is safe to remove "splitChunks" from the generated configuration
   * and was added as an educational example.
   *
   * https://webpack.js.org/plugins/split-chunks-plugin/
   *
   */
  
  module.exports = {
    mode: "development",
    entry: "./index.js",
  
    output: {
      filename: "server.js",
      path: path.resolve(__dirname, "dist")
    },
  
    plugins: [new webpack.ProgressPlugin()],
    externals: [nodeExternals()],
  
    module: {
      rules: [
        {
          test: /.(js|jsx)$/,
          include: [],
          loader: "babel-loader",
  
          options: {
            plugins: ["syntax-dynamic-import"],
  
            presets: [
              [
                "@babel/preset-env",
                {
                  modules: false
                }
              ]
            ]
          }
        }
      ]
    },
  
    optimization: {
      splitChunks: {
        cacheGroups: {
          vendors: {
            priority: -10,
            test: /[\\/]node_modules[\\/]/
          }
        },
  
        chunks: "async",
        minChunks: 1,
        minSize: 30000,
        name: true
      }
    }
  };
  