My folder structure is such:
functions
-- dist
-- private
-- server
---- controllers
---- middleware
------- clientAuth.js
------- someOtherAuth.js
---- index.js
---- model.js
---- router.js
I want to transpile all the .js files in my server folder into .dist. At present in my package.json I have
"scripts": {
"prepare": "babel ./server/**/*.js --retain-lines -d ./dist"
},
This only transpiles the files in the subdirectories in server, but not the files in the root of server. What can I use to transpile and place into .dist all the files in the root and the subdirectories?
If you are only going to have
.js
files in your server, you could replace./server/**/*.js
with./server/
So you would end up with
in case you still need just the
.js
extension, there should be an-x
flag to archive that