问题
I need to know if specifying "BundleTable.EnableOptimizations = true;"
will automatically minify the files (js & Css)or it will just select the .min if it is available ?
回答1:
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.
来源:https://stackoverflow.com/questions/25451388/does-bundletable-enableoptimizations-true-automatically-minify-the-files-or