IssueRaiser

Add new moduleResolution option: `yarn-pnp`

## Search Terms yarn pnp plug'n'play plug ## Suggestion Yarn has released a new feature for using modules without having a `node_modules` directory present: plug'n'play. Some community tooling is available for customizing the TypeScript compilerHost so that it can use plug'n'play modules, but this does not work for users of `tsc`. My suggestion is to add a new `"moduleResolution": "yarnpnp"` option. ## Use Cases / Examples I want to be able to use yarn plug-n-play in my typescript projects. My projects are typically yarn monorepos where common libraries are basic node packages using `tsc` for compilation. This would allow the basic projects to continue using `tsc`, but with an alternative module resolution scheme. Some community tooling has been created here for augmenting the CompileHost with a slightly updated moduleResolution strategy, but using it in basic projects would probably require a forked `tsc`. https://github.com/arcanis/ts-pnp ## Checklist My suggestion meets these guidelines: * [x] This wouldn't be a breaking change in existing TypeScript / JavaScript code * [x] This wouldn't change the runtime behavior of existing JavaScript code * [x] This could be implemented without emitting different JS based on the types of the expressions * [x] This isn't a runtime feature (e.g. new expression-level syntax)

Posted by darthtrevino on Nov 1, 2018, 6:57 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.4,000 issues0 comments

github (Software)

Add new moduleResolution option: `yarn-pnp`

darthtrevinoNov 1, 2018, 6:57 PM

## Search Terms yarn pnp plug'n'play plug ## Suggestion Yarn has released a new feature for using modules without having a `node_modules` directory present: plug'n'play. Some community tooling is available for customizing the TypeScript compilerHost so that it can use plug'n'play modules, but this does not work for users of `tsc`. My suggestion is to add a new `"moduleResolution": "yarnpnp"` option. ## Use Cases / Examples I want to be able to use yarn plug-n-play in my typescript projects. My projects are typically yarn monorepos where common libraries are basic node packages using `tsc` for compilation. This would allow the basic projects to continue using `tsc`, but with an alternative module resolution scheme. Some community tooling has been created here for augmenting the CompileHost with a slightly updated moduleResolution strategy, but using it in basic projects would probably require a forked `tsc`. https://github.com/arcanis/ts-pnp ## Checklist My suggestion meets these guidelines: * [x] This wouldn't be a breaking change in existing TypeScript / JavaScript code * [x] This wouldn't change the runtime behavior of existing JavaScript code * [x] This could be implemented without emitting different JS based on the types of the expressions * [x] This isn't a runtime feature (e.g. new expression-level syntax)

Comments (0)

No comments yet. Start the discussion.

Comment on this issue