Question

I have been creating projects using npm. For AMD I am using the native node require because it is convenient and does what I need it to do. To run my projects at the moment I am using grunt-watchify. This allows me to point a file of entry and a file of output. So at the moment it produces one file uncompressed or mangled.

I would like to know what is the best approach for compressing and mangling my final file. I have tried uglify after the file is built by watchify but it does not seem to work correctly. I feel that is a dirty hack anyway. So here is my questions?

What is the best way to build a node project into one file? Grunt library suggestions would be great. Any that support compression/minifying would also be great.

Thanks

Was it helpful?

Solution

Removed my dependency on grunt-watchify and now just use grunt-browersify and grunt-contrib-watch. I then use grunt-contrib-uglify and grunt-contrib-cssmin to minimize files afterwards.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top