scripts/build/bundler.js/getWebpackConfig
function getWebpackConfig(bundle) {
  if (bundle.type !== "plugin" || bundle.target !== "universal") {
    throw new Error("Must use rollup for this bundle");
  }

  const root = path.resolve(__dirname, "..", "..");
  const config = {
    mode: "production",
    performance: { hints: false },
    entry: path.resolve(root, bundle.input),
    module: {
      rules: [
        {
          test: /\.js$/,
          use: {
            loader: "babel-loader",
            options: getBabelConfig(bundle),
          },
        },
      ],
    },
    output: {
      path: path.resolve(root, "dist"),
      filename: bundle.output,
      library: {
        type: "umd",
        name: ["prettierPlugins", bundle.name],
      },
      // https://github.com/webpack/webpack/issues/6642
      globalObject: 'new Function("return this")()',
    },
    optimization: {},
    resolve: {
      // Webpack@5 can't resolve "postcss/lib/parser" and "postcss/lib/stringifier"" imported by `postcss-scss`
      // Ignore `exports` field to fix bundle script
      exportsFields: [],
    },
  };

  if (bundle.terserOptions) {
    const TerserPlugin = require("terser-webpack-plugin");
    config.optimization.minimizer = [new TerserPlugin(bundle.terserOptions)];
  }
  // config.optimization.minimize = false;

  return webpackNativeShims(config, ["os", "path", "util", "url", "fs"]);
}