does “BundleTable.EnableOptimizations = true;” automatically minify the files or it will just select the .min if it is available

梦想的初衷 提交于 2019-12-05 15:10:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!