Cassette (ASP.NET 4.x)


This guide applies only to ASP.NET 4.x. Please consider using webpack if possible.

Just want to see the code? Check out the sample project.

Cassette is an asset bundling library for ASP.NET. You can learn more on its website at ReactJS.NET supports the use of Cassette to compile JSX into JavaScript and minify it along with all your other JavaScript. To use Cassette with JSX, install the React.Cassette NuGet package and modify your CassetteConfiguration.cs file to include .jsx files in your bundle.

    // Add your JSX files here
    // You can include regular JavaScript files in the bundle too

This will add all three files into a main.js bundle that you can reference and render from your view using Cassette:

<!DOCTYPE html>
    <script crossorigin src=""></script>
    <script crossorigin src=""></script>

See the React.Samples.Cassette project for an example.

Precompilation #

Cassette supports using an MSBuild task to minify and combine your assets before deployment. This makes the start time of your application a lot quicker. Refer to the Cassette compile-time bundle generation using MSBuild documentation for more information.