在 Visual Studio 2010 或 2012 中发布网站时自动缩小 JavaScript 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13506601/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-26 18:59:20  来源:igfitidea点击:

Automatically minify JavaScript files at the time of Publishing website in Visual Studio 2010 or 2012?

javascriptasp.netvisual-studio-2010minifypublishing

提问by Rahul

Is there any way in VS 2010 or 2012 to minify JavaScript files at the time of Publishing?

在 VS 2010 或 2012 中是否有任何方法可以在发布时缩小 JavaScript 文件?

I want automatically minified js files. Any good example for compression?

我想要自动缩小的 js 文件。任何压缩的好例子?

Please note that I am not using MVC.

请注意,我没有使用 MVC。

回答by Jeroen

Use MVC 4. It bundles multiple scripts and minifies them.

使用 MVC 4。它捆绑多个脚本并缩小它们。

回答by Sidharth Mudgal

You can take a look at bundling and minificationif you are using ASP.NET 4.5.

如果您使用的是 ASP.NET 4.5,您可以查看捆绑和缩小