Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minify and Bundle NodeJS Project

Tags:

node.js

npm

gulp

Haven't found much information on this topic.

Is there any tooling (gulp) for minifying and bundling a nodejs server project including its node_module dependencies?

I have a scenario where I cannot run npm install on the production machine and I am limited to a maximum 20 MB "executable" size.

like image 346
ronag Avatar asked May 05 '15 10:05

ronag


1 Answers

You should take a look into the shrinkwrap options as well as the shrinkpack utility. It basically allows you to freeze your dependencies' versions, GZips your node modules and makes them easily deployable. You might not need Gulp for that, and Gzipping your packages is a lot more effective than uglifying it.

like image 73
ddprrt Avatar answered Nov 15 '22 10:11

ddprrt