Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Add instructions for using a custom root config

...

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

...

  1. Create a directory in your packmap package directory called "assets"
  2. Create a config.json file in that directory
  3. Add the command*
        ln -s $(realpath assets) openmrs/frontend/ 
    to the build script in package.json (separate it from previous commands with a &&)

  4. Add the following line to your override-import-map.json

        "config-file": "/openmrs/frontend/assets/config.json"

  5. 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)


*Sorry Windows users. Maybe one of you can fill in the equivalent thing to do here?