I haven't done webdev since 2010 and now that I look at it, it just seems so bizzare.
I haven't done webdev since 2010 and now that I look at it, it just seems so bizzare.
That should only take a few lines in a Makefile.
JSTARGETS = foo.js bar.js
build-js: $(JSTARGETS)
foo.js: foo_main.js lib_a.js lib_b.js
cat $< > $@
bar.js: bar_main.js lib_a.js lib_x.js lib_y.js
cat $< > $@
With make's builtin topological sort, adding dependency information to control the order or other unusual build requirements isn't hard to add.> output 6 images for all the sizes
IMAGES=( baz quux )
IMGSRC=(patsubst %,src/images/%.jpg,$(IMAGES))
IMGSML=(patsubst %,build/images/%-small.jpg,$(IMAGES))
build/images/%-small.jpg: src/images/%.jpg
convert $< -resize 25% $@
build-images: $(IMGSML)And the moment you accept that it is necessary (and why wouldn't it be - languages are for developers, not computers, and that means they by necessity will include cruft), you require a build system to at the very least, run the optimizer and minimizer.
It seems like a trivial problem but it isn't. We are long past the days when JS was only used to make an image blink.
It no longer does. The tools move on because the uses get more complex. See the sibling reply here for a good reason why.
[1]: https://github.com/tdewolff/minify/tree/master/cmd/minify