Some of my styles use url(../img/sprites/main_sprite.png) to local resources in development and stage. However in production I use CDN and all my static resources are on it. Is it possible to transform bundles so that all urls in .css are replaced with cdn path?
However, in production I would like it to be
I already use CssRewriteUrlTransform() to rewrite my relative paths to absolute, so the resources can be found after they bundled.
I was thinking to extend the class as something like this
public string Process(string includedVirtualPath, string input)
return new CssRewriteUrlTransform().Process(_cdn + VirtualPathUtility.ToAbsolute(includedVirtualPath), input);
return new CssRewriteUrlTransform().Process("~" + VirtualPathUtility.ToAbsolute(includedVirtualPath), input);
However, Process must have VirtualPath, otherwise it throws an exception when I append CDN path.
Is there an equivalent of this class to rewrite URLS with CDN in it?