process.traceDeprecation = true;
const path = require("path");
const patternslib_config = require("@patternslib/patternslib/webpack/webpack.config");
const svelte_config = require("@patternslib/pat-content-browser/webpack.svelte");

const webpack = require("webpack");
const { ModuleFederationPlugin } = require("webpack").container;

module.exports = async (env, argv, build_dirname = __dirname) => {
    let config = {
        entry: {
            "bundle": path.resolve(__dirname, "src/index.js"),
            "bundle-polyfills": path.resolve(build_dirname, "node_modules/@patternslib/patternslib/src/polyfills.js"), // prettier-ignore
        },
    };

    config = svelte_config(env, argv, patternslib_config(env, argv, config, ["mockup"]));
    config.output.path = path.resolve(__dirname, "dist/");

    config.plugins.push(
        new webpack.ProvidePlugin({
            Backbone: "backbone",
            _: "underscore",
        })
    );

    if (process.env.NODE_ENV === "development") {
        config.devServer.static = {
            directory: path.resolve(__dirname, "./docs/_site/"),
        };
        config.devServer.port = "8000";
        config.output.publicPath = "/dist/"; // publicPath to discover assets like the chunks directory
    }

    if (env && env.DEPLOYMENT === "plone") {
        config.output.path = path.resolve(
            build_dirname,
            "../plone.staticresources/src/plone/staticresources/static/bundle-plone/"
        );
    }

    config.plugins.push(
        new ModuleFederationPlugin({
            shared: {
                "@patternslib/patternslib": {
                    singleton: true,
                },
            },
        })
    );

    return config;
};

@@ -265,73 +265,8 @@
 k%22);
-%0Aconst %7B ModuleFederationPlugin %7D = require(%22webpack%22).container;
 %0A%0Amo
@@ -1415,228 +1415,8 @@
  %7D%0A%0A
-    config.plugins.push(%0A        new ModuleFederationPlugin(%7B%0A            shared: %7B%0A                %22@patternslib/patternslib%22: %7B%0A                    singleton: true,%0A                %7D,%0A            %7D,%0A        %7D)%0A    );%0A%0A
     

Use module federation config from base Patternslib config.