缩小ASP.NET生成的Javascript的最佳方法是什么? [英] What's the best way to minify the ASP.NET generated Javascript?
问题描述
在运行时在ASP.NET 3.5中缩小ASP.NET生成的Javascript(例如webresource.axd提供的Javascript)的最佳方法是什么?我尝试使用 MbCompression 模块,但它没有使用这些资源。
What's the best way to minify the ASP.NET generated Javascript, such as the ones served by webresource.axd, in ASP.NET 3.5 at runtime? I tried using the MbCompression module but it's not working with those resources.
推荐答案
如果你想缩小ASP.NET AJAX JavaScript,请确保你已经更新了web.config的编译部分以关闭调试模式:
If you want to minify the ASP.NET AJAX JavaScript, ensure that you've updated the compilation section of your web.config to turn off Debug mode:
<compilation debug="false">
这将确保缩小ScriptResource文件,但是除非你提供了JS的缩小版本文件,这些不会被触及。
This will ensure that the ScriptResource files are minified, however unless you've supplied minified versions of your JS files, these won't be touched.
这篇关于缩小ASP.NET生成的Javascript的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!