Some time ago 开发者_如何学GoI saw a javascript library/development tool that takes several .js files (or modules, for that matter) and "compiles" it into one .js file. The goal of this tool is to facilitate the client-side development.
The sad thing is that I forgot the name of this tool. Does anyone knows the name of this library/tool (or some tool like this)?
You are possibly thinking of Chirpy?
Mashes, minifies, and validates your javascript, stylesheet, and dotless files. Chirpy can also auto-update T4MVC and other T4 templates.
Chirpy is chippy. Use Google Closure Tools, YUI Compressor for .Net, Ajax Minifier, or Uglify.js to minify and mash all of your precious assets. It's easy, it's flexible, and it's automatic.
Chirpy also flirts with T4. Auto-run your T4 templates. Smart-run your T4MVC template. Make your friends and family members uber-jealous.
NEW Chirpy now supports CoffeeScript!
I really don't know what IDE you saw in the past.
But it can be done with Visual Studio 2010 with Build Events.
Take a look at this thread for more explanation and other ideas: Visual Studio 2010: Publish minified javascript files instead of the original ones. Other options here: Compress CSS/JavaScript before publish/package.
I know of two tools that do this. They each take different approaches.
- Yahoo's YUI Compressor simply combines files, removes whitespace, and doesn't actually affect readability much. It reduces file size a little.
- Google's Closure compiler actually "compiles" JS by simplifying certain types of expressions, rewriting variables, etc. Reduces file size a lot.
The Closure compiler doesn't give you easily-readable code, but it does the best job of reducing file size of these two. It also has various compilation optimizations that you can use. The YUI compressor page links to some more types of compressors that they replaced.
Both tools use a Java JAR file that accepts input files and an output file, which you can run before uploading your Javascript.
精彩评论