How to strip all comments from the testing build?

How to strip all comments from the testing build?

I noticed that my testing build app.js file is 1.9Mb, and in the interest of saving bandwidth and loading time I want to strip comments during the build process. I know I can do this with uglifyjs, but how would I integrate this as part of the compilation process?