1.0.1 • Published 2 years ago
hce-saas v1.0.1
microfrontend-template
This repo serves as a template for starting a new UI application which can be loaded as a microfrontend in the NextGenUI Harness app.
Note: Please don't make application-specific changes to this repo
Creating a new application
To use this template, simply click the "Use this template" button on the top-right, OR
- Create a new repo in Github
- Select this repo as the template in the creation wizard
Getting started
To compile and run the new application in standalone mode (without integrating into NextGenUI), run the following commands:
$ yarn
$ yarn start
Integrating with NextGenUI
You need to follow a few steps before you can integrate your microfrontend with NextGenUI.
- Set the name of your application in
config/moduleFederation.config.js
by replacingnew_module_ui
with your app's name.
Tip: This name will be used by NextGenUI to refer to your app and load it.
This name should be unique.
- Change the local CSS identifier setting in
config/webpack.common.js
fromnew_module_[name]
to include your module's name.
Tip: This identifier is appended to all CSS classes declared in your module.
Having a unique prefix helps avoid CSS classname collisions, and also makes debugging easier in NextGenUI.
- In NextGenUI, in
configs/modulefederation.config.js
, add an entry for your module to be loaded, like so:
remotes.new_module = "new_module_ui@[window.getApiBaseUrl('new_module_ui/remoteEntry.js')]";
Tip: Make sure to replace `new_module_ui` with the name you selected in step 1.
1.0.1
2 years ago