34
loading...
This website collects cookies to deliver better user experience
Was Micro-Frontend Architecture essential for this project?
Make a common config
file with the shared config for dev & prod build, for example:
// imports ...
module.exports = {
// all shared config ...
};
Make a dev config
and merge it with the common config
const { merge } = require('webpack-merge');
// other imports ...
const devConfig = {
// all development config ...
},
};
module.exports = merge(commonConfig, devConfig);
Finally make a prod config
and merge it with the common config
const { merge } = require('webpack-merge');
// other imports ...
const prodConfig = {
// all production config ...
},
};
module.exports = merge(commonConfig, prodConfig);
mount
function which takes simple objects as params. It has the following signature:type Mount = (
mountPoint: HTMLElement,
{
defaultHistory?: History | MemoryHistory;
initialPath?: string;
isAuthenticated?: boolean;
routes: {
HOME: string;
ABOUT: string;
FAQ: string;
TERMS_AND_CONDITIONS: string;
PRIVACY_POLICY: string;
DISCLAIMER: string;
CAMPAIGNS: string;
SIGN_IN: string;
};
onNavigate?: ({ pathname: string }) => void;,
},
) => {
onParentNavigate: ({ pathname: string }) => void
}
mount
function, the container can mount the sub-app as per requirement. defaultHistory
, onNavigate
and onParentNavigate
are used to keep both the container and the sub-app in sync and avoid some nasty bugs.mount
function with a similar set of params and handling the sign-in and sign-up pages I am a beginner, how should I learn Front-End Web Dev?
Look into the following articles:
Would you mentor me?
Sorry, I am already under a lot of workload and would not have the time to mentor anyone.
Would you like to collaborate on our site?
As mentioned in the previous question, I am in a time crunch, so I would have to pass on such opportunities.