diff --git a/micro-ui/web/packages/core/src/modules/registerRemotes.js b/micro-ui/web/packages/core/src/modules/registerRemotes.js index 8249d2fb0fd..fccf1e04d2d 100644 --- a/micro-ui/web/packages/core/src/modules/registerRemotes.js +++ b/micro-ui/web/packages/core/src/modules/registerRemotes.js @@ -9,16 +9,16 @@ export default (queryClient) => { const userType = Digit.UserService.getType(); - // registerApplication({ - // name: "Workbench", - // app: () => import("workbench/WorkbenchModule"), - // activeWhen: `/${window.contextPath ? window.contextPath : "core-digit-ui"}/employee/workbench`, - // customProps: { - // title: "Workbench is running on host", - // queryClient, - // userType - // }, - // }); + registerApplication({ + name: "Workbench", + app: () => import("workbench/WorkbenchModule"), + activeWhen: `/${window.contextPath ? window.contextPath : "core-digit-ui"}/employee/workbench`, + customProps: { + title: "Workbench is running on host", + queryClient, + userType + }, + }); registerApplication({ diff --git a/micro-ui/web/packages/core/webpack.prod.js b/micro-ui/web/packages/core/webpack.prod.js index 67520fd4ede..d0b32fe3189 100644 --- a/micro-ui/web/packages/core/webpack.prod.js +++ b/micro-ui/web/packages/core/webpack.prod.js @@ -22,7 +22,7 @@ module.exports = () => { hrms: `hrms@${domain}/hrms-ui/remoteEntry.js`, common: `common@${domain}/common-ui/remoteEntry.js`, pgr: `pgr@${domain}/pgr-ui/remoteEntry.js`, - // workbench : `workbench@${domain}/workbench-mfe/remoteEntry.js`, + workbench : `workbench@${domain}/workbench-mfe/remoteEntry.js`, dss : `dss@${domain}/dss-ui/remoteEntry.js`, // measurement : `measurement@${domain}/measurement/remoteEntry.js` }, diff --git a/micro-ui/web/packages/workbench/webpack.prod.js b/micro-ui/web/packages/workbench/webpack.prod.js index f60991d55ef..44c0667d8d7 100644 --- a/micro-ui/web/packages/workbench/webpack.prod.js +++ b/micro-ui/web/packages/workbench/webpack.prod.js @@ -1,7 +1,12 @@ +require('dotenv').config(); + const { merge } = require("webpack-merge"); const ModuleFederationPlugin = require("webpack/lib/container/ModuleFederationPlugin"); const commonConfig = require("./webpack.common"); const packageJson = require("./package.json"); +const MiniCssExtractPlugin = require('mini-css-extract-plugin'); +const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); +const ExternalRemotesPlugin = require('external-remotes-plugin'); module.exports = () => { const prodConfig = { @@ -11,6 +16,7 @@ module.exports = () => { filename: "[name].[contenthash].js", }, plugins: [ + new ExternalRemotesPlugin(), new ModuleFederationPlugin({ name: "workbench", filename: "remoteEntry.js", @@ -40,7 +46,19 @@ module.exports = () => { "classnames": "^2.3.2" } }), - ], + new MiniCssExtractPlugin( + false + ? { + filename: 'static/css/[name].[contenthash].css', + chunkFilename: 'static/css/[name].[contenthash].css', + } + : {} + ), + ].filter(Boolean), + optimization: { + minimize: true, //true if prod + minimizer: ['...', new CssMinimizerPlugin()], + }, }; return merge(commonConfig, prodConfig);