3 ms·
Why I prefer package.json over makefiles: - turborepo (https://turborepo.org/ https://turborepo.org/) can describe dependency pipelines and provide automatic c
by spion 5y ago
Why I prefer package.json over makefiles:
- turborepo (https://turborepo.org/ https://turborepo.org/) can describe dependency pipelines and provide automatic caching. Makefiles aren't designed for multi-input, multi-output scenarios - its really awkward: https://www.gnu.org/software/automake/manual/html_node/Multiple-Outputs.html https://www.gnu.org/software/automake/manual/html_node/Multi... and https://stackoverflow.com/questions/39237306/makefile-compiles-all-tsc-regardless-of-changes https://stackoverflow.com/questions/39237306/makefile-compil...
- turborepo can also run never-ending targets in parallel (e.g. API server and static file server in development mode). Not sure how well make supports that
- turborepo can depend on env var values. Makefiles can to, but like everything with makefiles, its an awkward workaround: https://stackoverflow.com/questions/14840474/make-target-which-depends-on-an-environment-variable https://stackoverflow.com/questions/14840474/make-target-whi...
- makefiles do not work on Windows (They are portable, just not to platforms most node devs care about)
- Its unclear whether `make` will ever add features to remove the awkwardness for supporting the various scenarios above. It doesn't seem likely to happen.
- spion 5y agoAlso, it says something about the design of `scripts` that its so easy to build something like turborepo's dependency pipeline on top of it :)