Forum

Steffen Decker
Keymaster
    Has successfully completed the online course Intermediate (200)
11 months ago #47514
Up
3
Down
::

Hi Christopher,
until we officially support static modules, you can also dynamically load modules via the official import() declaration. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import

For example when using import inside a Simplifier library:

import(“https://mozilla.github.io/pdf.js/build/pdf.mjs”).then((pdflib) => {
window.pdflib= pdflib;
});

You can of course use the import function directly inside a client side business object, without exposing the loaded library as a window property.

Kind regards
Steffen