Open DrZim opened 12 years ago
Do you mean to minify JavaScript? Or do you mean actually obfuscate?
It appears to minify already. I do mean obfuscate. Any docs on how to add this to it (or maybe have it part of the project?)
Assuming you're on the v2 branch (it's in beta, soon to be released)...
Implement the IAssetTransformer
interface and add your obfuscation code (you'll find examples of this throughout the Cassette code e.g. https://github.com/andrewdavey/cassette/blob/v2/src/Cassette/Stylesheets/ExpandCssUrlsAssetTransformer.cs ).
This transformer can then be added to assets using a Bundle processor. See https://github.com/andrewdavey/cassette/blob/v2/src/Cassette/BundleProcessing/AddTransformerToAssets.cs for an example IBundleProcessor
base class that does this.
You will probably want to add an extension method to make it easy to use your obfuscator. See https://github.com/andrewdavey/cassette/blob/v2/src/Cassette/Stylesheets/StylesheetBundleExtensions.cs for ideas.
The end result will be something like:
bundles.Add<ScriptBundle>("scripts", b => b.Obfuscate());
FWIW combined and minified javascript is pretty damn obfuscated already!
Any way to add an obfuscate option for javascript? (I looked fairly well for this option so I apologize if I missed it.)