Skip to Content
1
Feb 03, 2023 at 11:17 AM

Loading an ES6 Module in SAPUI5

493 Views Last edit Feb 03, 2023 at 08:17 PM 4 rev

Hello everyone,

I'm currently facing a problem with an external library, which has been written in TypeScript and has been compiled for ES6 modules (so there are import and export keywords).

Now when I try to use this library in my own library, I use the sap.ui.loader.config, to load it. So this looks like this:

 sap.ui.loader.config({
     paths: {
         'libs/scandit/core': 'https://unpkg.com/scandit-web-datacapture-core@6.16.0/build/js/index'
     }
 });

Now when I try to run my library it will fail with the following error message:

image.png

So now my question is, can I somehow convert this external library in to CommonJS code in order to use this or how should I adapt the shims configuration?

Does anyone have an idea?

Thanks and best regards

Attachments

image.png (54.3 kB)