/* eslint-disable @typescript-eslint/no-var-requires */
const merge = require("webpack-merge");
const { setupCommonConfig } = require("./common");
const commonClientConfig = require("./client");
const commonProdConfig = require("./commonProd");
const prodClientPlugins = require("./prodClientPlugins");

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

    const clientConfig = merge(commonConfig, commonClientConfig, commonProdConfig, {
        entry: {
            shell: "./modules/shell/Entry.ts",
        },
        plugins: prodClientPlugins(false),
    });

    return clientConfig;
};
