node.jsgitnpmbowergit-bash

Create workflow for a "Global" bower_components folder for all of your projects?


Side Note: I'm not looking for "opinion-based" answers..I don't want this to get thrown into that category. I'm looking for the proper method to simplify my workflow with the tools we have available.


Problem I've been running into lately:
I'm installing multiple duplicate libraries (jquery + bootstrap for example) on my local disk Over and Over and Over again when starting new projects...

1. Create "new-client" folder
2. cd.. new-client
3. git clone my-starter-code
4. npm install (installing multiple dev dependency duplicates on disk)
5. bower install (installing multiple dependency duplicates on disk)
6. begin coding!

This seems to be wasteful to me if all of these projects Always have the same base structure:


What build tools can be utilized to create such a workflow?



I realize that all projects are different in there own way, but if they all start out the same,, does it not make sense to use one "Master" directory for these "Global" files instead of having 100's of duplicate projects?

I began thinking about this from developing with modular "Web Components" (the new W3C Standard).

This has made me want to make my workflow more modular, simplified, and automated.


Solution

  • pNPM

    Fast, disk space efficient package manager

    https://pnpm.io/