Cassette's Bundles helper works in view pages, layouts and partials.
Reference the scripts you directly require.
Tell Cassette where to render the <script> tags.
Stylesheets and HTML Templates are also supported
@{
Bundles.Reference("Scripts/app/page.js");
}
<!DOCTYPE html>
<html>
<head>
<title>Web App</title>
@Bundles.RenderScripts()
</head>
<body>
...
</body>
</html>
When debug="true" in Web.config:
The SHA-1 hash is used. The output here has been shortened to fit on screen.
<!DOCTYPE html>
<html>
<head>
<title>Web App</title>
<script src="/Scripts/lib/jquery.js?a4babad4b" type="text/javascript"></script>
<script src="/Scripts/lib/jquery-ui.js?53dd39212" type="text/javascript"></script>
<script src="/Scripts/app/tools.js?4d03ae0b" type="text/javascript"></script>
<script src="/Scripts/app/widgets.js?cf319fe0b" type="text/javascript"></script>
<script src="/Scripts/app/page.js?485f05e21" type="text/javascript"></script>
</head>
<body>
...
</body>
</html>
With a single change to Web.config, debug="false", Cassette switches into high performance mode.
<!DOCTYPE html>
<html>
<head>
<title>Web App</title>
<script src="/_assets/scripts/Scripts/lib_4bad47afb" type="text/javascript"></script>
<script src="/_assets/scripts/Scripts/app_b7c29fecc" type="text/javascript"></script>
</head>
<body>
...
</body>
</html>
This introduction has only scratched the surface of what Cassette can do.
.coffee files to your project and Cassette will compile them.Get Cassette! It's free, open source software, distributed under the MIT License.