Skip to content

Instantly share code, notes, and snippets.

@prabirshrestha
Created October 27, 2012 21:59
Show Gist options
  • Save prabirshrestha/3966534 to your computer and use it in GitHub Desktop.
Save prabirshrestha/3966534 to your computer and use it in GitHub Desktop.
public class CassetteBundleConfiguration : IConfiguration<BundleCollection>
{
private readonly string rootPath;
public CassetteBundleConfiguration()
{
this.rootPath = HostingEnvironment.MapPath("~/");
//this.rootPath = rootPathProvider.GetRootPath();
}
public void Configure(BundleCollection bundles)
{
// Please read http://getcassette.net/documentation/configuration
bundles.Add<StylesheetBundle>("assets/stylesheets/style.less");
bundles.Add<ScriptBundle>("assets/javascripts/_vendors/jquery.js", b => b.PageLocation = "jquery");
var sprockets = new Sprockets();
var node = sprockets.Scan(Path.Combine(this.rootPath, "assets/javascripts/main.js"));
var deps = node.ResolveDependencies();
bundles.Add<ScriptBundle>("assets/javascripts/main.js", deps.Select(d => d.Data.AbsolutePath), b => b.PageLocation = "app");
bundles.Add<HtmlTemplateBundle>("assets/templates");
}
public class CustomCassetteServices : IConfiguration<TinyIoCContainer> // Cassette scans for these when initializing itself
{
public void Configure(TinyIoCContainer container)
{
container.Register<IHtmlTemplateScriptStrategy, GlobalVarHtmlTemplateScriptStrategy>();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment