简体   繁体   中英

JavaScript minifyer which can be integrated with a build of an ASP.NET application

灵感来自这个答案 ..你们可以指点我类似的东西 - 可以集成到构建脚本中,或者可能直接集成到Visual Studio中吗?

Visual Studio projects use MSBuild, so you can integrate an MSBuild task that uses whatever javascript minifier you'd like.

This has been blogged about pretty extensively so I won't bother trying to come up with the specifics here... but a quick google search yielded some good posts.

http://www.coderjournal.com/2008/05/how-to-create-a-yui-compressor-msbuild-task/

http://blog.mastykarz.nl/minify-your-javascript-and-save-the-kbs-for-later-imtech-javascript-minificator-free-tool/

The first link from womps post (Nick Berardi's blog post) uses the YUI Compressor for java . So if you don't want to have the extra dependency of java / installing java, then you can do the same thing with a .NET port of the most excellent YUI Compressor project -> YUICompressor for .NET .

Maybe that might help :)

*Disclaimer: I did most of that port.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM