Skip to content

Instantly share code, notes, and snippets.

@fschwiet
Created October 29, 2011 19:04
Show Gist options
  • Save fschwiet/1324940 to your computer and use it in GitHub Desktop.
Save fschwiet/1324940 to your computer and use it in GitHub Desktop.
an interesting bit of code. An http endpoint as minified resources main.js, main.test.js, main.css, main.ie.css, main.print.css.
public class StaticResources : NancyModule, IResourceBundler
{
public StaticResources()
{
this.isAvailableAt("cdn/");
this.includesFiles(
@"lib\jquery",
@"lib\jquery-ui-1.8.16\jquery.ui.core.js",
@"lib\jquery-ui-1.8.16\jquery.ui.widget.js",
@"lib\jquery-ui-1.8.16\jquery.ui.mouse.js",
@"lib\jquery-ui-1.8.16\jquery.ui.position.js",
@"lib\jquery-ui-1.8.16",
@"lib\underscore",
@"lib\json2",
@"lib\JsfIoc",
@"lib\joshuaclayton-blueprint-css\blueprint",
@"projects\common",
@"projects\main");
this.translates("less", "css", n => LessCompiler.Load(n));
this.translates("html", "js", n => HtmlResourceCompiler.Load(n));
this.translates("coffee", "js", n => CoffeeCompiler.Load(n));
this.buildsResource("main.print.css")
.fromFile("print.css")
.withRemainingAsResource("main.ie.css")
.fromFile("ie.css")
.withRemainingAsResource("main.css")
.fromFile("*.css");
this.buildsResource("main.test.js")
.fromFile("*.testutil.js")
.fromFile("*.tests.js")
.fromFile("*.test.js")
.fromFile("testutilities/")
.withRemainingAsResource("main.js")
.fromFile("*.html")
.fromFile("*.js");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment