3 ms·
I've been moving most of my projects over to Makefiles, instead of npm scripts [1]. Unless I am missing something obvious, it's nicer to run: make vs. npm star
by umaar 6y ago
I've been moving most of my projects over to Makefiles, instead of npm scripts [1]. Unless I am missing something obvious, it's nicer to run:
make vs. npm start
make thing vs. npm run thing
But also more importantly, the Makefile itself feels much cleaner, rather than stuffing scripts in package.json files. The thing I'm confused about, why do npm scripts seem to dominate? I don't see many people using Makefiles.
[1] https://github.com/umaar/video-everyday/blob/master/Makefile https://github.com/umaar/video-everyday/blob/master/Makefile
- mstade 6y agoI had your point of view until I started working in corporate environments where windows reign supreme, and then I understood that the reason why no one wrote Makefiles or shell scripts is simply because no one had access to those runtime environments. JavaScript, however, truly is everywhere these days. Sure, you can run Make and even shells on windows now, but that doesn't mean you have the power or even capability to do so in a corporate environment where IT dictates only reluctantly provides you with a machine in the first place.
- stouset 6y agoLife is too short to work in these kinds of environments, if you can avoid it.
- mark_and_sweep 6y agoI actually find using Make on Windows to be really simple. I usually drop a prebuilt make.exe into the project directory since it's just 244kb (http://www.equation.com/servlet/equation.cmd?fa=make http://www.equation.com/servlet/equation.cmd?fa=make, https://github.com/MarkTiedemann/make-for-windows https://github.com/MarkTiedemann/make-for-windows). If the Makefile needs to be cross-platform, that's easy to do, too: ``` ifeq ($(OS),Windows_NT) # Windows else # *nix endif ```
- lmm 6y agoMakefiles are much less cross-platform and much less clear about their dependencies. A hand-written Makefile probably won't work on FreeBSD unless you've deliberately tested it there, much less Windows, and is probably relying on a bunch of GNU-only flags in the utilities it calls. Some of them are probably from a newer version of that utility than what ships on OSX. Etc.