Skip to content

Support yarn hoisted packages in a workspace context #4667

Closed
@easadev

Description

@easadev

Is your feature request related to a problem? Please describe.

nativescript already supports yarn (which is nice). Yarn has a feature called workspaces (https://yarnpkg.com/en/docs/workspaces), however, a nativescript app does not work under a workspace context, because yarn hoists common package and nativescript has a fixed mechanism to look up for package.json files inside its relative node_modules.

Describe the solution you'd like

Ideally, nativescript should use node modules resolution algorithm to look up for those package.json files.

Describe alternatives you've considered

Additional context

/my-monorepo
--/node_modules
----/@angular/*
--/my-nativescript-app
----package.json
----/node_modules
------/nativescript-*
--/my-webapp
----package.json
----/node_modules
------/bootstrap

This is how a workspace looks like in yarn. since "my-webapp" and "my-nativescript-app" both use same @angular/* version, yarn hoists these packages.. this conflicts with nativescript, since in the build process it will check for a my-nativescript-app/node_modules/@angular/core/package.json file, and since this is no longer the case, the app does does not build.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions