Deployment and front-end challenges

We’re changing to having some of our front-end built on deploy now. Both major front-end modules (one for desktop, one for mobile) are node packages and use a gulp script to build. We’ve got the build process working fine without much trouble, but since we blow away our main directory on deploy to clean out stale code, that also wipes out the node_modules and bower_components directories for each of these packages, causing them to refetch/install every deploy.

Any obvious and clean strategies for maintaining these caches while still clearing out the main directory? Is copying those directories to some /cache/ location a viable option?

(asking while trying more options – it’s taking a while to iterate on this problem ;))

@Philonous We’ve got a similar stack and build process. Building everything from scratch was taking too long and we were bumping into issues using FROMCACHE.

We tried some complicated bash commands to delete everything except node_modules and gems, which worked but was a little janky.

We nded up just building our own Docker image. Ve started from a base ruby image, then had a Dockerfile that installed node, copied over Gemfile and package.json, installed gems and npm packages, then uploaded the built image to It’s effectively a custom cache, but also saves time on the “Flattening and exporting image to cache” step.

interesting, thanks. I’ll check into that approach. appreciate it!