Add workspaces support to recursively compile monorepo packages!
- Dominant language
- TypeScript
- Stars
- 44k
- Forks
- 6k
- Avg merge
- 5d 15h
- Merged PRs (30d)
- 23
Description
## Feature Request
**Is your feature request related to a problem? Please describe.**
Both `yarn` and `jest` have added first-class support for monorepos, there is the `workspaces` property from `package.json` that enables a recursive `node_modules` install in a single command for yarn, and the same idea for jest with the `jest.projects` property.
It would be really nice to have likewise a proper monorepo support for babel, with a clean way to compile all packages at once (each one outputing relatively to their root being key here!), instead of having to rely on other packages (eg. `lerna`) or non cross-compatible scripts (eg. `find -execdir`).
Should speed up compiling time a bit and slightly reduce the tooling needed for the growing trend of using monorepos.
**Describe the solution you'd like**
I think having either a `.babelrc` `workspaces/projects` key could work (eg. `packages/*`), or maybe add a CLI flag like `--enable-workspaces` that would look for yarn's (non namespaced) `workspaces` property?
Would be nice to have this for the `7.0` release 😄, could try to set up a PR if there is interest/consensus.
Contributor guide
Research direction
Start by reviewing the existing CLI and configuration entry points, then compare the proposed .babelrc workspaces/projects key with package.json's workspaces property and Jest's projects property. The issue does not name tests or implementation files. Done means an agreed design supports recursively compiling monorepo packages with output relative to each package root.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- build-system, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100