Search code examples
debuggingwro4j

wro4j -- How do you disable aggregation feature in debug mode?


I'm using wildcards to load my javascript and css files and it works great, but it's a pain to work with the aggregated javascript files during the development phase. Is there a way to have wro4j not aggregate the files, but just include them individually?

My wro.xml File

<groups xmlns="http://www.isdc.ro/wro">
 <group name="external">
    <js>/app/lib/*.js</js>
 </group>

 <group name="application">
    <js>/js/*.js</js>
    <css>/css/normalize.css</css>
    <css>/css/*.css</css>
 </group>
</groups>

Thanks!


Solution

  • There is a trick to achieve that in development mode (debug=true). There is an endpoint (/wro/wroAPI/model - this is valid if you are mapping WroFilter to /wro/*) which returns a JSON representation of the model. Using this JSON, you can easily insert scripts and/or css links for a given group by iterating group entries. There is no such widget yet available by default, but if you create one and want to contribute it - you're welcome :).