Skip to content

Make @angular-devkit/core/node/resolve independent of node_modules resolution #16981

Closed
@bgotink

Description

@bgotink

🚀 Feature request

Description

The custom resolution provided by @angular-devkit/core/node/resolve reimplements the node_module resolution algorithm, which doesn't work for package manages that don't use node_modules (yarn 2 with plug'n'play, npm tink if that gets revived).

Describe the solution you'd like

Replace the custom node_modules implementation with calls to either require.resolve with the paths option or to a require function created using createRequire.
These functions work regardless of the used package manager (yarn 1, yarn 2 with pnp, npm, pnpm, …)

Describe alternatives you've considered

  • Override the resolution, using either
    • setResolveHook
    • a patch applied to the @angular-devkit/core package via yarn 2's patch protocol or via a yarn plugin
  • Explicitly query the yarn PnP API, but that would require plug'n'play-specific logic in the resolution file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions