The World's Most Boring Build System
jezenthomas.com
jezenthomas.com
/foo/a.js
/foo/b/c.js
/foo/d/e.js
And you want minified files to be written to: /bar/a.js
/bar/b/c.js
/bar/d/e.js
I'm not a huge fan of Grunt/Gulp, but doing this is very easy using those tools. SOURCES := $(shell find foo -type f -name '*.js')
TARGETS := $(patsubst foo/%,bar/%,$(SOURCES))
.PHONY: all
all: $(TARGETS)
bar/%.js: foo/%.js
mkdir -p $(dir $@)
minify $< > $@ SOURCES := $(shell find foo -type f -name '*.jsx')
TARGETS := $(patsubst foo/%.jsx,bar/%.js,$(SOURCES))
.PHONY: all
all: $(TARGETS)
bar/%.js: foo/%.jsx
mkdir -p $(dir $@)
minify $< > $@You can have some sort of high-level js.mk scattered in each directory of your project, then there's a top level Makefile which will include all those js.mk files and expand them from high level definitions to make rules.
Make is good only if you create a sort of framework around for your domain. However the learning curve is way too steep. I would only attempt to use make if Gulp does its job horribly bad.