I want to transpile JS files in a folder recursively and overwrite the same files with transpiled JS.
babel build/sample.js --out-file build/sample.js
Using the above command, I can transpile a single file. How could I do this recursively over a folder?
Edit:
I don't want to use Webpack.
My Source code will be in a different folder 'A' (with js.php files). And I use a PHP build process to generate a build folder 'B' (with .js files). I want to apply Babel on folder 'B' after generating the build folder.
I can't afford the time to make changes on to run Babel before the PHP build process now.