Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Lerna and/or Yarn Workspaces

See original GitHub issue

Are there any plans to support Lerna? By default Lerna uses the packages directory to store the packages. Right now the content of that folder is not transpiled so it’s not possible to use ES6 code in there. It would be nice to have the possibility to use Lerna to create a monorepo application with create-react-app.

I’ve tried using the src directory with Lerna, but that conflicts with not ignoring node_modules directory inside the src directory, so it gives a ton of lint errors when you do so.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:385
  • Comments:198 (27 by maintainers)

github_iconTop GitHub Comments

MikeSuitercommented, Nov 19, 2018

What would be nice at this point if someone from the CRA team would post what the status of supporting monorepos is. Do they still plan on going the nwb route with documentation and when can we expect to see it?

There are a lot of people interested in using CRA with monorepos so code can be shared among apps and several of them have posted what they’ve tried to do. One thing that is common with all the attempts to support monorepos with CRA is they work but not with the experience people want. What we currently have working is a decent solution but then there are annoyances like not being able to debug source code (debugging transpiled code is ugly).

jedrichardscommented, Sep 7, 2017

For me the holy grail of Lerna support with CRA would look something like,

├── package.json
└── packages
    ├── api
    │   └── package.json
    ├── components
    │   └── package.json
    ├── cra-app-1
    │   └── package.json
    ├── cra-app-2
    │   └── package.json
    └── something-else
        └── package.json

The idea here is that we have a monorepo for web clients that can contain multiple CRA-based apps as peers that have access to a few shared other packages (e.g. a lib of shared presentational components, maybe a lib with some api calling utils, anything else). The CRA apps should be able to require code from the other packages and Babel should know to transpile such code coming from within the monorepo automatically.

Is this possible with Lerna and CRA at the moment? Any related issues or info I can look at?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bether JS-code completion for monorepos (with lerna andor ...
In monorepos via lerna or yarn workspaces, all libraries installed via yarn are stored in node_modules inside the root directory.
Read more >
A Beginner's Guide to Lerna with Yarn Workspaces | by jsilvax
When coupled together, Lerna and Yarn Workspaces can ease and optimize the management of working with multi-package repositories.
Read more >
Managing Monorepo using Lerna and Yarn workspaces
This section describes the way to use Lerna and Yarn Workspaces to manage Monorepo. ... First, you have to set the private and...
Read more >
Workspaces in Yarn | Yarn Blog
Internally it uses Yarn or the npm CLI to bootstrap (i.e. install all third party dependencies for each package) a project. In a...
Read more >
Monorepo Javascript Projects with Yarn Workspaces and Lerna
Yarn workspaces are used to optimize dependency management. When we use yarn workspaces, all project dependencies are installed in one go. Tools ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found