Concatenate files using babel
问题 Here's my file structure /base.js /foo/main.js /foo/bar/main.js /baz/main.js I want 4 files in total. One for each leaf node of the tree with all the content of it's 'included' files. Here are file's contents. base.js //anything really /foo/main.js include 'base.js' /foo/bar/main.js include 'base.js' include '/foo/main.js' /baz/main.js include 'base.js' These 'includes' are like php includes in that they are concatenated at babel's compile time not the traditional includes from es2016/es2016.