Adding modules to runtime

Any script can extend the runtime module system, Live offers a utility function to expose a directory of javascript modules.

The directory structure

It is advised to create a shared folder within your project, like so:

Suggested directory structure

Exposing the entire "shared" directory

Inside the shared folder create index.ts file with the following content:

Import the shared index file from the app entry point

That's it! Your modules are ready to be required by another plugin's web application.

Example result

Before importing from plugin-example there are some configurations needed to be set up.

1. Configure your webpack.config.js to treat these modules as external

2. Configure your pom.xml to add explicitly show that dependency

Now you're set up to import modules from plugin-example!

3. Import from plugin-example in any module

Last updated

Was this helpful?