Re: How to specify order in which to compress & consolidate js files?

29 views
Skip to first unread message

Alex Objelean

unread,
May 24, 2013, 7:18:55 AM5/24/13
to wr...@googlegroups.com
The consolidated order is not random, it is exactly the same as it is specified in the model (wro.xml). In case you are using wildcards, the order is alphabetical. 

Cheers,
Alex

On Friday, May 24, 2013 2:10:51 PM UTC+3, avcmc wrote:
This tool is extremely fantastic. Thanks to all who have contributed to it.

We have recently started using it and are currently facing an issue as following:

"Is there anyway through which we can specify the order in which the files should be consolidated while creating a common file?"

A use-case for this is say when there are more than one files in a folder and after consolidation they become a single file but the order in which they are compressed is either random or I guess alphabetical. 

Due to this random consolidation, errors creep up in JS code in case say code segment 'A' should have been processed before code segment 'B' but in the consolidated file code segment 'B' is above 'A'.

Any solution for such a case anyone.

Thanks for help in advance.


avcmc

unread,
May 24, 2013, 7:25:52 AM5/24/13
to wr...@googlegroups.com
Thanks Alex. You are a Rockstar!

Was just not expecting such a quick response. Great.

Well, given your reply, I guess then I need to create proper groups of my js files and then include them in the same order while accessing.

Also Alex, is it possible that I first create some minified files during build process and then during same build process I again consolidate them to become ultimately a single file?

Use-Case like this that there are many folders and for each folder I created a group which gave me a single file for each folder - now, can I combine these individual files from each folder ultimately leading to one single file - and all this happening in a single build process.

Is this currently feasible?

Regards

Alex Objelean

unread,
May 24, 2013, 7:36:38 AM5/24/13
to wr...@googlegroups.com
You can create a group which reference existing groups like this:

 <group name="g1">
     
<group-ref>g2</group-ref>
 
</group>


Regards,
Alex


--
You received this message because you are subscribed to the Google Groups "wro4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wro4j+un...@googlegroups.com.
To post to this group, send email to wr...@googlegroups.com.
Visit this group at http://groups.google.com/group/wro4j?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

avcmc

unread,
May 24, 2013, 8:21:43 AM5/24/13
to wr...@googlegroups.com
Thanks for link Alex and also for the time so far.

Regards

avcmc

unread,
May 24, 2013, 2:07:19 PM5/24/13
to wr...@googlegroups.com
I have been able to find a solution for this. The order in which the js files will be consolidated would be same as mentioned in the group tag as following:

<group name="plugins_grid_filters_feature_types">
<js>/resources/js/plugins/grid/filter/Filter.js</js>
<js>/resources/js/plugins/grid/filter/BooleanFilter.js</js>
<js>/resources/js/plugins/grid/filter/DateFilter.js</js>
</group>

Here all the above files are in the same folder & are part of same group. Also, alphabetically BooleanFilter.js appears before Filter.js, but for project Filter.js should be accessed before BooleanFilter.js, thus, for this the expected order should be mentioned in the group tag as shared above.

Hope this helps someone looking for the same.

Thanks again to Alex and everyone else associated with this wonderful project.

Regards
Reply all
Reply to author
Forward
0 new messages