What does SassAndCoffee do?
How to use SassAndCoffee
- Add the package reference via NuGet
- Add a .coffee, .scss, or .sass file to your project (an easy test is to just rename a CSS file to .scss)
- Reference the file as if it was a CSS or .JS file (i.e. to reference “scripts/test.coffee”, you should reference “scripts/test.js” in your SCRIPT tag)
- To get the minified version of a file (either a coffee file or a standard js file), ask for the “.min.js” version (i.e. “scripts/test.min.js”)
Some things you don’t have to do
- Install any extra software, such as Ruby – everything is embedded in resources.
- Do any special configuration or make manual changes to your config files – NuGet will handle that.
- Do any special setup whatsoever when deploying – if it works on your box, it’ll work on the remote box (*)
* – a special note: VS2010 likes to mark CoffeeScript files as ‘do not deploy’ – make sure to hit F4 and mark them as content
What’s New in SassAndCoffee 0.8 – Minification and Combination
- Open your View file, you probably have references to a bunch of scripts, whose source looks something like:
- Copy the actual references (i.e. starting from ‘~’ on) to a file whose extension is “.combine” (i.e. ‘debug_all.combine’). These files don’t necessarily have to exist on-disk (i.e. they can be a CoffeeScript file). You can also just write a list of filenames, relative to the .combine file.
- If you change either the combine file or any file that it references, it will rebuilt – no need to rebuild anything by hand!
You can see an example of how this is used in the WebTest project on GitHub.
What else is new?
- Scripts are compiled/minified in parallel, improving performance. Unfortunately, minifying a significant number of scripts still takes a long time – this will be dramatically improved in the next release.
- Several bugs were fixed, such as fixing projects that didn’t have an App_Data folder, as well as a race condition where zero-length files could possibly be served up.