Merging javascript from various widgets
From Widget Framework
2.0.0 it is possible to merge javascript files from various widgets.
Purpose is to reduce lots of javascript file inclusion in the header.
Browser has to open HTTP connection for each individual file present in
the header which hampers the performance of site. So, merging
javascripts files to a single file will improve the performance. Merging
is done by maven shade plugin and ant. Condition is that if you have
javascript plugin or code for widgets you have to put that in
<widget>/src/main/webapp/jscripts
directory.
You can put as many javascript file in the jscripts directory. The
merged javascript file will be created in
<war>/resources/js/wf-widget.js
.
widget1 src main webapp jscripts somejs1.js somejs2.js ...
widget2 src main webapp jscripts somejs3.js somejs4.js ...
Be careful about javascript files having the same name. If there is more than one file with same name then maven shade plugin will consider only the first one.