Created
September 10, 2012 06:02
-
-
Save slynch13/3689144 to your computer and use it in GitHub Desktop.
dotless css bundle transform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LessTransform : IBundleTransform | |
{ | |
public void Process(BundleContext context, BundleResponse response) | |
{ | |
var parser = new Parser(); | |
var importPath = context.HttpContext.Server.MapPath(context.BundleVirtualPath); | |
parser.Importer = new BundleImporter(importPath); | |
var env = new Env { Compress = true, Debug = true, KeepFirstSpecialComment = true, DisableVariableRedefines = false }; | |
response.Content = parser.Parse(response.Content, null).ToCSS(env); | |
response.ContentType = "text/css"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment