...
At this point, you should have microfrontends working entirely offline!
*Sorry Windows users. Maybe one of you can fill in the equivalent thing to do here?
Adding configuration and assets without a custom root config
...
- Create a directory in your packmap package directory called "assets"
- Create a config.json file in that directory
Add the command*
ln -s $(realpath assets) openmrs/frontend/
to the build script inpackage.json
(separate it from previous commands with a&&
)- Add the following line to your override-import-map.json
"config-file": "/openmrs/frontend/assets/config.json"
That config file can refer to things you put in that assets directory, which will be served under
localhost:8080/openmrs/frontend/assets/
...
Using a custom root config
TODO
Once your root config is published, you can add it to the packmap package like any other module. If the main
line of your root config's package.json
is set correctly, packmap should correctly add it to the import map.
openmrs-module-spa by default uses @openmrs/esm-root-config as the root config. Change it using the OpenMRS setting "spa.rootConfig" (pending PR)