const { merge } = require("webpack-merge");
const { setupCommonConfig } = require("./common");
const commonClientConfig = require("./client");
const setupCommonProd = require("./commonProd");
const prodClientPlugins = require("./prodClientPlugins");

module.exports = env => {
    const commonConfig = setupCommonConfig(false, env);

    const clientConfig = merge(commonConfig, commonClientConfig, setupCommonProd(env), {
        entry: {
            public: "./modules/client-framework/Entry.ts",
        },
        plugins: prodClientPlugins(),
    });

    return clientConfig;
};
