1.0.1 • Published 2 years ago

hce-saas v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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

  1. Create a new repo in Github
  2. 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.

  1. Set the name of your application in config/moduleFederation.config.js by replacing new_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.
  1. Change the local CSS identifier setting in config/webpack.common.js from new_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.
  1. 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.