Created
June 4, 2021 21:38
-
-
Save copyrighthero/3ff8eaca62eb684730828fbe91118c5d to your computer and use it in GitHub Desktop.
Generic makefile for running npm commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARGS = build clean pack start test | |
MAKECMDGOALS ?= clean | |
$(ARGS): | |
npm run $(MAKECMDGOALS) | |
.PHONY: $(ARGS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This Makefile will allow you to run any
npm
commands that you have specified in theARGS
variable.i.e.
make
by default will runnpm run clean
, which is specified to be the default forMAKECMDGOALS
i.e.
make start
will runnpm run start
, etc.