uglifyJs doesn't work

61 views
Skip to first unread message

fip...@gmail.com

unread,
Feb 8, 2016, 5:03:20 AM2/8/16
to wro4j
Hi!
I'm trying to use the wro4j in my web site, running on Google AppEngine.
I'd like to use the runtime optimization, so I configured the wro filter in the web.xml.

I followed the recommended settings for the AppEngine, described in the FAQ here: http://wro4j.readthedocs.org/en/latest/FAQ/

I added the jsMin and the uglifyJs to the wro4j filter's configuration in the web.xml, see below:

<filter>
<filter-name>WebResourceOptimizer</filter-name>
<filter-class>
ro.isdc.wro.http.WroFilter
</filter-class>
<init-param>
<param-name>jmxEnabled</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>disableCache</param-name>
<param-value>false</param-value>
</init-param>
<init-param>
<param-name>minimizeEnabled</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>preProcessors</param-name>
<param-value>jsMin,uglifyJs</param-value>
</init-param>
<init-param>
<param-name>postProcessors</param-name>
<param-value></param-value>
</init-param>
</filter>


The problem: the jsMin seems working, it means that my js scripts are minimized, whitespaces removed etc.
But it seems that the uglifyJs doesn't work, in my js scripts are still full property/function names, it's not shortened etc.

Maybe I need to use a different processor for that?

Can anyone help me, please?
Thanks!
Filip

Alex Objelean

unread,
Feb 8, 2016, 5:45:30 AM2/8/16
to wr...@googlegroups.com
Assuming the wro4j-extensions module is added, the uglifyJs should work (unless it fails to process and leaves the resources unchanged). First of all check if there are any errors or warnings in the logs.
I would recommend using googleClosure processor instead of uglifyJs, because it is much faster and should.

Cheers,
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 https://groups.google.com/group/wro4j.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Fipil

unread,
Feb 10, 2016, 2:15:50 AM2/10/16
to wro4j
Hi, I overlooked the following important part in the documentation: http://wro4j.readthedocs.org/en/latest/ConfigurableWroManagerFactory/
I was missing the first important line in my wro.properties.
managerFactoryClassName=ro.isdc.wro.manager.factory.ConfigurableWroManagerFactory

So that was the reason, why post/pre processors didn't work at all.

Dne pondělí 8. února 2016 11:45:30 UTC+1 Alex Objelean napsal(a):

Alex Objelean

unread,
Feb 10, 2016, 4:50:36 AM2/10/16
to wr...@googlegroups.com
Glad you have figured it out. 
I still would recommend using a googleClosure or googleClosureAdvanced, since it is much faster comparing to rhino based uglifyJs processor.

Cheers,
Alex
Reply all
Reply to author
Forward
0 new messages