Re:Yarn Plug'n'Play: Getting rid of node_modules
by mhenr18 on Thursday September 13, 2018 @09:56AM
(#17978611)
As a data point, my company is using yarn workspaces where one of the projects is an Electron app, and another has a Node server with native dependencies.
Our nohoist section currently looks like this in order to get things to behave:
"nohoist": [
"**/electron/**",
"**/electron",
"**/electron*/**",
"**/electron*",
"**/canvas-prebuilt/**",
"**/canvas-prebuilt"
]
These are likely going to require auto-ejection due to being native and having postinstall scripts.Would it make sense to not bother with hoisting of ejected modules when using YPnP, given that YPnP solves the same problems as hoisting in a more global way? We'd be able to get rid of the nohoist section in that case.
Re:Yarn Plug'n'Play: Getting rid of node_modules
by audiolion on Thursday September 13, 2018 @12:36PM
(#17979955)
The reason I use nohoist is because my monorepo has a react native package and web package inside it, I found that if I hoist react native stuff it doesn't resolve properly with the metro bundler, so I have to nohoist every react native package.
Nohoist was a bit of a hack from the beginning (precisely because the hoisting was anything but guaranteed), so some incompatibility might happen for packages that cannot work without.
That said, I'm not too worried: we've tried a bunch of the most popular open-source packages, and they all seemed to work fine - the one issue was on an interaction between create-react-app and eslint, but there's discussions going on to fix that in a clean way.