Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
// package.json in the project root
"name": "my-workspace-project",
"version": "1.2.3",
"workspaces": {
"packages": [
// four packages in the folder
// w: should share peer and intra-project deps with other workspaces
// x: has peerDependency on react-native, should be isolated
// y: depends on z, but at a different version, by design
// z: should not share any of its dependencies with anyone else
// this is just enough like overrides to be confusing... hmmm......
"dependencyIsolation": {
// nothing for w, we just want the default behavior
// isolate the x>react-native peer dep, even though it's a peer
"x": {
"react-native": true
// isolate y's dependency on z, even though it's intra-project
"y": {
"z": true
// isolate z's dependencies entirely, do not hoist any of them.
// OR, does this isolate z when it IS a dependency? Or both?
"z": true,
// isolate all deps on react-native
// equivalent to "nohoist": ["**/react-native"]
"react-native": true
// maybe isolate *all* workspace deps with `"dependencyIsolation": true`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment