Minifying js files

1
0
-1

Hello,
I have created a custom page using UI designer. In the page I have several custom widgets, the problem is in the index.html it loads different js corresponding to each widget independently. Is it a way to concatenate these independent js files and then minify them? Any link/demo code to solve this problem would be helpful. Thanks.

2 answers

1
0
-1

Sharing the link to my post: http://zealfire.github.io/Optimizing-Bonita-BPM/. Hoping it helps someone.

Comments

Submitted by Sean McP on Thu, 04/13/2017 - 05:46

Excellent research work, well studied and highly recommended to others,

Bonitasoft - you should have a read of this for all customers and future versions of the software.

regards

1
0
-1

Good question,

we've added a JavaScript file to the PAGE, any JavaScript in here will also be accessible from the Custom Widget therefore meeting your requirement of only one load (or less loads at least).

It does separate the JavaScript from the Widget but it does what you want.

Then once you're satisfied you can minify using http://www.minifier.org/ for example.

regards
Seán

PS: While this may not be the complete answer you're hoping for, it does indicate a possible solution, please mark as resolved.

Comments

Submitted by zealfire on Wed, 03/29/2017 - 13:55

Yeah, concatenation part seems feasible to me. I am not sure how minifying the file is going to work with different json used within page by bonita.
Update: I tried to minify the common js files but it throws Error: [$injector:unpr], any suggestion to mitigate this?

Thanks

Notifications