Created
October 27, 2012 21:59
-
-
Save prabirshrestha/3966534 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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