Page 1 of 1

Using Require with commons.js

Posted: Fri Apr 29, 2022 11:03 am
by MikeH
Inside our framework we are storing JavaScript code in the commons.js file.
However the code is getting lengthy and I would like to break it up into multiple files.
Can you provide example JS for how to include other JavaScript files.
How do I require/import them into commons.js and do I have to put anything specific inside the "imported" files?

Thanks

Re: Using Require with commons.js

Posted: Mon May 02, 2022 9:23 am
by Radu
Hi Mike,

I'm afraid we do not support including additional javascript files directly from the commons.js.
So the "commons.js" is for now a single Javascript file which is loaded up and used by Oxygen. If you would plan to split it in multiple Javascript file you would need to add some processing to generate the large "commons.js" to be shipped with the final framework folder.

Regards,
Radu