Use the toolbar
load/unload
button to load/unload the module.
This example shows how to handle library dependencies.
Example location: https://github.com/genesys/modkit-loader/tree/master/examples/umd
This one makes use of DayJS in order to add a new view, containing date information of the post.
DayJS is added as an external dependency, therefore, it is not bundled in the module, but it should be present in the parent application.
The
Load DayJS
button will load DayJS via CDN.
This has to be done prior to use theLoad #1
button.
The
Load #1
button will load the module, assuming the dependency is present in the application, under the globalwindow.dayjs
variable.
If dayjs has not been loaded before, it should result in an error.
The
Load #2
button will load the module, but as a requirement, it will loadwindow.dayjs
with a cdn endpoint if not already present in the application.
It should load DayJS, load the module and add a new view on the current page.
It should add the last documentation update date on the top right part of the page.