This project has moved and is read-only. For the latest updates, please go here.

Exclude files from yui compression

Feb 21, 2014 at 2:38 PM
Using the following code string

bundle.Transforms.Add(new BundleTransformer.Core.Transformers.JsTransformer(new YuiJsMinifier()));

how can I choose to exclude certain files from minification? I tried the ignorePatterns parameter but that seemed to exclude the entire file from the bundle.
Feb 21, 2014 at 4:34 PM
Hello, ZNS!

What you want to do is impossible.

I don't understand why you need it? In any case, Bundle Transformer (by default) does not produce the re-minification of code of pre-minified assets (for example, files with the extension *.min.js and *.min.css).

Give an example of files, that you want to exclude from the minification process.
Feb 21, 2014 at 5:54 PM
Alright, because that is what I wanted to achive. To ignore already minified files. So if I name them ".min.js" they will be ignored by yui compressor? I had an issue with this though when doing bundle.IncludeDirectory("path", "*.js")". In this case files called ".min.js" were entirely excluded from the bundle. But maybe this is just an issue with the searchPattern?
Feb 21, 2014 at 6:40 PM
Edited Feb 21, 2014 at 6:42 PM
You only need rename files to .min.js and the Bundle Transformer will do the rest for you.

Search patterns only needs to exclude the files from bundle (it has no relation to the minification process). For search patterns .min.js and .js is almost the same.

I recommend to you attentively read the documentation.