I'm working on an MVC4 site, and I would like to use some resource management software to consolidate & minify JS & CSS (+ less & coffeescript),
SquishIt has all the plugins I want, they're already configured. All the examples show a very simple idea behind SquishIt, which never includes any asset management. It looks like (and the JavaScript model is almost identical):
<html>
<head>
@Html.BundleCss()
.Add("~/Content/first_file.css")
.Add("~/Content/second_file.css")
.Add("~/Content/third_file.css")
.Render()
</head>
What I'm wanting to do is more like this:
_Layout.cshtml:
<html>
<head>
@Html.BundleCss().Render()
</head>
....
App_Start():
Bundle.Css().Add("~/Content/bootstrap.css").Add("~/Content/jquery-ui.css");
_PartialView.cshtml:
@Html.BundleCss().AddString("a:active { color: red }")
The idea behind this is that I would build up the CSS/JS I need as the views recursively render and then the minifier builds, minifies, and caches at the end. AssMan (http://assman.codeplex.com/) does this, but seems less supported and requires more work to get the required minifiers and language support I want.
Ideas, suggestions?