No More Ctrl-F5
Last night at a ridiculous hour I released the latest version of my asset preprocessor for .NET
Cruncher can handle nested CSS
@import statements, re-maps relative resource urls and has a self cleaning cache should any changes be made to any of the referenced files. It can also parse CSS and add vendor prefixes to rules by Can I Use using AutoPrefixer.
You can, and most definitely should get it here
How it works
Finally links are produced in the page as follows.
Where the name is the hash of the combined output. This allows the native static file handler to take over which is great for performance (though all this activity is also heavily cached both in the browser and the server). If any changes are detected by file monitors for each file and imported files then the number will change which forces the browser to request the updated output. That allows instant propagation of changes made to the input files. No More Ctrl-F5!
It really couldn't be easier. Simply add
@using Cruncher to your view and use the following methods to add resources. This all works in webforms syntax also.
There's a great writeup of the
defer attributes here
Feel free to have a good look through the sourcecode. It's all, as ever, open source under the Apache 2.0 license and contributions are most welcome.
I'd very much like to thank both Alain (I'm so sorry I have forgotten your surname) for providing some simply awesome ideas and code and Jeroen Breuer for reporting bugs and providing me with projects to tests against for this release. You both got me revisiting code I'd long forgotten about and didn't realise anyone was using.