Visual Studio 2010: Publish minified javascript files instead of the original ones

后端 未结 5 1684
天命终不由人
天命终不由人 2020-12-07 17:57

I have a Scripts folder, that includes all the .js files used in the project. Using the Ajax Minifier task, I generate .min.js files for each one. Depending on whether the a

5条回答
  •  -上瘾入骨i
    2020-12-07 18:41

    If you want to do Javascript minification via Visual Studio, this will get you started: http://encosia.com/2009/05/20/automatically-minify-and-combine-javascript-in-visual-studio/

    Otherwise, I'd recommend a tool that can automatically combine and minify Javascript. The two tools that I have looked at are Justin Etheredge's Bundler and Combres. I'm using Bundler in my current project and one of my work colleagues is using Combres. Bundler is a little bit simpler to use but it does less than Combres. With Bundler if debug is turned off in web.config then it doesn't minify and combine which means that you can debug the javascript in your dev environment.

    P.S. Bundler was renamed to SquishIt.

提交回复
热议问题