v5 experimental extractor esbuild "packages" config
I was trying out the experimental extractor in the v5 preview and noticed it was missing a lot of strings that my own bespoke extractor was picking up. It turns out the difference is that you've set the packages config to external, which was causing all our monorepo packages to get excluded.
Fortunately, we can override the esbuild config, so we can just unset the packages config. But i'm flagging this as a bug, since I would imagine you want to support monorepos out of the box.
Do you use a monorepo with a "real" packages linked using node_modules?
Every monorepo is different, there might be integrated monorepo's, where packages are bound using tsconfig path aliases and monorepo with standalone packages.
The idea behind setting "packages: external" was to support integrated monorepos out of the box, since esbuild will resolve aliases before checking is path external.
But for "packaged" monorepo things is much more complicated, I believe even in previous setup it didn't work out of the box and you had to specify some additional settings to make it work.
There no recipe which will work out of the box for all cases, thats why I allowed to override esbuild config. I also believe, may be mistakenly, that integrated approach is more popular since it's more advertised from popular monorepo tools, such as turborepo and nx.
So i'm not sure is that a bug or not.
We're using pnpm + turborepo. Monorepo packages are exposed as symlinks in each workspace's node_modules directory, rather than using aliases. As far as I can tell we're not doing anything bespoke with respect to how it's setup, but I could be wrong.
I also ran into this problem. In my "Independently Maintained Dependencies" NX monorepository, I came across the fact that I cannot use baseUrl (and paths accordingly) in tsconfig due to the fact that esbuild does not resolve paths with includeDeps.
Removing this will solve the problem. But at the same time, I limit myself to using aliases, which is necessary for me to use shadcn.
@AndrewIngram @Dragonite24 i prepared a solution https://github.com/lingui/js-lingui/pull/2362, please let me know if it cover the issue or did i miss something, i need a feedback because i'm not dogfooding that extractor myself.
Available in v5.6.0