by metalliqaz · 8y ago · 0 comments
This makefile snippet:
lib/index.js: src/index.js
mkdir -p $(dir $@)
babel $< --out-file $@ --source-maps
The source and the output are both called index.js? Why, God, WHY???The capitalized rending-of-garments is silly. This is transpiling; file names should remain the same from input to output.
It is not realistic/optimal to try to write your javascript to be supported by all browsers or runtime clients. It's better to write using the latest spec, and just have it dumbed down for you by transpilers at build time
Some more explanation here: https://www.excella.com/insights/typescript-vs-es6-vs-es2015
Of course that sentence contains it's own level of craziness, but the problem does not lie in the build step.