Documentation

Twitter Bootstrap

Cassette won't be able to compile the LESS files provided with Twitter Bootstrap by default. This is because bootstrap.less uses a set of @import statements to build up the final LESS file; where Cassette will attempt to compile each file in the directory.

In this tutorial we will assume that you have set up your project structure as follows:

Content/
- Styles/
  - accordion.less
  - ...
  - bootstrap.less
  - ...

Option 1: Using a bundle.txt File

You can inform Cassette that you only want to compile a certain set of files by adding a bundle.txt file into the Styles folder, and include exactly one line in the file:

bootstrap.less

You will also need to enter in any custom LESS files (on separate lines) that do not appear in main bootstrap.less file.

Option 2: Using Configuration

You can also use the CassetteConfiguration.cs class to inform Cassette that it should not compile all the files in the directory. Simply add a new line to Configure method as such:

public class CassetteConfiguration : ICassetteConfiguration
{
    public void Configure(BundleCollection bundles, CassetteSettings settings)
    {
        // Ensure that Cassette doesn't compile all the
        // .less files in ~/Content/Styles.
        bundles.Add<StylesheetBundle>("Content/Styles/bootstrap.less");
    }
}

This piece of code will also need to be maintained so that it stays in sync with any additional LESS files you have, that do not appear in the bootstrap.less file.

Concerns

Due to the fact that the Twitter Bootstrap LESS files cannot stand alone make sure that you do not Reference any Twitter Bootstrap LESS files in your views or pages apart from bootstrap.less.