Using local npm modules with Make
I’ve written about the advantages of using npm scripts as a build system. Another alternative is to use Make, which works great for tasks with a lot of steps or if you prefer to keep the line length in check.
You can modify your PATH by
adding the following at the top of your Makefile
:
You can now use the binaries that same way as with npm scripts:
You can also use some of the Make’s built-in variables and functions to make it more reusable:
The $@
variable represents the target file while the $<
is the source
file.
Windows support
Make is available through Make for Windows, Gow and a dozen other installers.