Skip to content

Commit

Permalink
updated workbench prod conf and enabled it
Browse files Browse the repository at this point in the history
  • Loading branch information
nipunarora-eGov committed Mar 20, 2024
1 parent 3647f72 commit 5a16c01
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 12 deletions.
20 changes: 10 additions & 10 deletions micro-ui/web/packages/core/src/modules/registerRemotes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion micro-ui/web/packages/core/webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
},
Expand Down
20 changes: 19 additions & 1 deletion micro-ui/web/packages/workbench/webpack.prod.js
Original file line number Diff line number Diff line change
@@ -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 = {
Expand All @@ -11,6 +16,7 @@ module.exports = () => {
filename: "[name].[contenthash].js",
},
plugins: [
new ExternalRemotesPlugin(),
new ModuleFederationPlugin({
name: "workbench",
filename: "remoteEntry.js",
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 5a16c01

Please sign in to comment.