Documentation

Introduction

Cassette is an web asset management library. An asset is typically a file, such as script or stylesheet. Assets are grouped into bundles. A bundle is processed to produce an optimized output that improves the performance of your web application.

Cassette supports three types of bundle: scripts, stylesheets and HTML templates.

Script bundles contain JavaScript assets, such as .js and .coffee files.

Stylesheet bundles contain CSS assets, such as .css, .less and .scss files.

HTML template bundles contain .htm files used by client-side HTML templating libraries, such as jQuery-tmpl and Hogan.

Getting started

Install the Cassette.Aspnet nuget package into your ASP.NET web application project.

This will update Web.config and create a new file called CassetteConfiguration.cs.

Configuration

Cassette needs to know what files to bundle. This requires implementing a small class using the Cassette configuration API.

Learn about Configuration »

Bundles helper class

Cassette provides a simple in-page helper class called Bundles. The Bundles class allows a page/master/view/partial/etc to reference bundles. Next, the Render methods are used to actually generate the required HTML, such as <script> tags.

Learn about the Bundles helper »