Using Require with commons.js

Post here questions and problems related to oXygen frameworks/document types.
MikeH
Posts: 5
Joined: Tue Apr 19, 2022 1:28 pm

Using Require with commons.js

Post 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
Radu
Posts: 9041
Joined: Fri Jul 09, 2004 5:18 pm

Re: Using Require with commons.js

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply