Is there any module in NodeJS to concatenate and minify JavaScript files?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fs
- Keeping track of variable instances
If you like the Rails 3.1 asset pipeline approach, you should try my connect-assets library.
If you're using Connect, then I've had good luck with Connect-Assetmanager
UglifyJS is a Node module that is all about minifying javascript. I don't think it also joins files, but there might be an option I missed.
Edit: With UglifyJS 2, it has built in concatenation as well.
If you want to do this inline in your node app it's really easy. This allows you to dynamically generate your minified/concatenated js script at runtime without using the grunt or yeoman way.
and in your module: