Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are the .min of versions files used when `BundleTable.EnableOptimizations = true`?

Does specifying BundleTable.EnableOptimizations = true minify all CSS and JS files in a bundle, or are the available min versions of files used?

like image 568
john Gu Avatar asked Aug 22 '14 16:08

john Gu


1 Answers

One has nothing to do with the other. BundleTable.EnableOptimizations exists merely to provide a way to force bundling in development, where it's disabled by default. In production, it's enabled by default, and unnecessary to specify anything for EnableOptimizations. Either way, though, it only determines whether bundling will happen or not, not how it will occur or what will happen as a result.

That said, the standard behavior is to bundle but not minify anything that has a companion file with in the form of [filename].min.[ext]. It will simply take the minified source file and dump its content into the bundle. If there is no companion file, then the original file will be minified first before bundling.

like image 87
Chris Pratt Avatar answered Nov 16 '22 00:11

Chris Pratt