Ignore CSS imports

51 views
Skip to first unread message

mar...@frightanic.com

unread,
Oct 30, 2015, 9:52:44 AM10/30/15
to wro4j
Is there an option to ignore CSS imports? I have a CSS artifact provided by a front-end agency which imports fast fonts stuff. When processed by wro4j on a server that can't connect to the Internet this fails badly:

Caused by: java.net.UnknownHostException: fast.fonts.net
        at java
.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
       
...
        at ro
.isdc.wro.model.resource.locator.UrlUriLocator.locate(UrlUriLocator.java:86)
        at ro
.isdc.wro.model.resource.locator.factory.InjectableUriLocatorFactoryDecorator.locate(InjectableUriLocatorFactoryDecorator.java:37)
        at ro
.isdc.wro.model.group.processor.PreProcessorExecutor.getResourceContent(PreProcessorExecutor.java:249)
        at ro
.isdc.wro.model.group.processor.PreProcessorExecutor.applyPreProcessors(PreProcessorExecutor.java:189)
        at ro
.isdc.wro.model.group.processor.PreProcessorExecutor.processAndMerge(PreProcessorExecutor.java:103)

The CSS looks like this:
@import url("http://fast.fonts.net/t/1.css?apiType=css&projectid=<some-code>");
html
{
  font
-family: sans-serif;
...


Alex Objelean

unread,
Nov 2, 2015, 5:22:27 AM11/2/15
to wro4j

Hi Marcel,

you could remove the cssImport processor which is responsible for locating & replacing the import statements with actual css content.

Does that answer your question or you are looking for a different workaround?

Thanks,
Alex

Marcel Stör

unread,
Nov 2, 2015, 9:11:38 AM11/2/15
to wro4j
On Monday, November 2, 2015 at 11:22:27 AM UTC+1, Alex Objelean wrote:
you could remove the cssImport processor which is responsible for locating & replacing the import statements with actual css content.

I found it on http://wro4j.readthedocs.org/en/stable/AvailableProcessors/ but I haven't found a reference as for how to actually remove it. 

Alex Objelean

unread,
Nov 2, 2015, 9:17:51 AM11/2/15
to wr...@googlegroups.com
If you are using ConfigurableWroManagerFactory, just remove the cssImport alias from the list of preProcessors.

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

Marcel Stör

unread,
Nov 2, 2015, 9:17:52 AM11/2/15
to wro4j
Reply all
Reply to author
Forward
0 new messages