text: const path = require("path");
  const TerserPlugin = require("terser-webpack-plugin");
  const webpack = require("webpack");
  const { BundleAnalyzerPlugin } = require("webpack-bundle-analyzer");
  
  function getEntry(name) {
      const obj = {};
  
      obj[`tsparticles.shape.${name}`] = "./dist/shape.js";
      obj[`tsparticles.shape.${name}.min`] = "./dist/shape.js";
  
      return obj;
  }
  
  function getConfig(entry, banner, minBanner) {
      return {
          entry: entry,
          output: {
              path: path.resolve(__dirname, "dist"),
              filename: "[name].js",
              libraryTarget: "umd",
              globalObject: "this"
          },
          resolve: {
              extensions: [ ".js", ".json" ]
          },
          externals: [
              {
                  tsparticles: {
                      commonjs: "tsparticles",
                      commonjs2: "tsparticles",
                      amd: "tsparticles",
                      root: "window"
                  },
              }
          ],
          module: {
              rules: [
                  {
                      // Include ts, tsx, js, and jsx files.
                      test: /\.js$/,
                      exclude: /node_modules/,
                      loader: "babel-loader"
                  }
              ]
          },
          plugins: [
              new webpack.BannerPlugin({
                  banner,
                  exclude: /\.min\.js$/
              }),
              new webpack.BannerPlugin({
                  banner: minBanner,
                  include: /\.min\.js$/
              }),
              new BundleAnalyzerPlugin({
                  openAnalyzer: false,
                  analyzerMode: "static",
                  exclude: /\.min\.js$/,
                  reportFilename: `${reportFileName}.html`
              })
          ],
          optimization: {
              minimize: true,
              minimizer: [
                  new TerserPlugin({
                      include: /\.min\.js$/,
                      terserOptions: {
                          output: {
                              comments: minBanner
                          }
                      },
                      extractComments: false
                  })
              ]
          }
      };
  }
  
  module.exports = {
      getEntry,
      getConfig
  };
  