Babel doesn't transpile subfolders

1k Views Asked by At

My folder structure:

package.json
src
├── backend
│   ├── routes
│   │   ├── myRoute.js
├── index.js
├── .babelrc

The command i run from package.json: "build:server": "babel src/backend/ -d dist"

The resulting dist folder structure:

dist
├── src
│   ├── backend
    │   ├── index.js

How can i get it to transpile all subfolders within backend as well? I tried babel src/backend/** -d dist and that didn't work either.

1

There are 1 best solutions below

0
On

You should move your .babelrc file to the root of your directory