Closed nvartolomei closed 8 years ago
I'm on a train now so please forgive the short reply. I'm referring to the examples in the readme of phantomjs and node-sass where platform binaries are installed. Your workaround is new to me though, does that work for those packages? Thanks for sharing this, it's really helpful.
The idea is that node_modules
is generally going to contain tens of thousands of files, taking up well over 100MB, and quite possibly containing a number of platform-specific build artifacts (ie, libraries that required native code to be compiled during installation). Checking in node_modules
in that situation will waste large amounts of space, take a long time, and cause problems if someone needs to check out the repo on another platform.
With Shrinkpack, the platform-agnostic tarballs are checked in instead. Way fewer total files, probably smaller, and because the platform-specific artifacts are built on package install, the repo can be checked out and npm install
ed on any valid platform.
Thanks a lot @markerikson.
Can you provide examples of this?
My solution is checking in node_modules, ignoring the following patterns and running
npm rebuild
on checking out.