I've scouered the documentation for Babel and cannot seem to find an answer, so I turn to the glorious community.
With a directory structure like this:
src/
    folder1/
        file1.js
        file2.js
    folder2/
        file3.js
    folder3/
        file4.js
        file5.js
I want Babel to transpile all files into a flattened directory:
lib/
    file1.js
    file2.js
    file3.js
    file4.js
    file5.js
No matter what I try, Babel always inherits the src/ directory structure. Any ideas?
If you are using babel-cli, you can do this:
babel folder1 folder2 folder3 folder4 -d lib
which works fine if you have a limited number of folders. It'll output them all flattened.
To expand on samanime's answer, if you're using babel-cli, you can simply use a wildcard on your parent folder...
babel src/** -d lib
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With