Bruno Lopes - 442 - May 16, 2014

We’re using the ServiceStack bundler to bundle several css files from plugins, widgets and other assorted vendor drops into one or two css files. To keep things tidy and easy to discern, each vendor drop exists on a separate folder (one for select2, one for jquery ui, etc).

This means that we need to rewrite the urls in the css to add parts of the path, since images and fonts are on the vendor folder, but the minified css would exist one step up.

I’ve looked at CleanCSS and it supports that scenario, but haven’t found how to actually implement it using Bundler. I was able to pass some options to CleanCSS after removing the lowercase transform and some other shenneningans, but it wasn’t possible to pass a different folder to each file.

Is it possible to rewrite the urls on css using bundler?

Do you know how to do with cleancss? because options defined in #options get passed to cleancss
https://github.com/ServiceStack/Bundler#example-file-with-options

Otherwise you may need customize how cleanCss is called by editing bundler.js: 
https://github.com/ServiceStack/Bundler/blob/master/src/bundler.js#L455

Bruno Lopes:

I think that bundler.js lowercases the options ( https://github.com/ServiceStack/Bundler/blob/master/src/bundler.js#L139 ), and it seems like all files in a bundle get the same options, which is not what we need. 

I was hoping to avoid maintaing a custom version of bundler…