Forum

Steffen Decker
      Has successfully completed the online course Intermediate (200)
    1 month 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