From 68de8d34a64cbf8ad70f4f514685d9b119fac74b Mon Sep 17 00:00:00 2001 From: Takashi Sato Date: Thu, 23 Feb 2023 16:48:20 +0900 Subject: [PATCH] docs: description for use with pnpm --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index c3d23ed..3df6c59 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,18 @@ npm i -D better-typescript-lib Starting from TypeScript 4.5, the TypeScript compiler detects existence of `@typescript/xxx` packages (e.g. `@typescript/es2015`) and uses them instead of the built-in definitions. By installing `better-typescript-lib`, these package names are mapped to corresponding `@better-typescript-lib/xxx` packages. +### with pnpm + +With pnpm, you must append the following line to the `.npmrc` file: + +```properties +public-hoist-pattern[]=@typescript/* +``` + +With pnpm the `@better-typescript-lib/xxx` packages are not installed to `node_modules/@typescript/xxx` without [`public-hoist-pattern`](https://pnpm.io/npmrc#public-hoist-pattern). + +This is because, unlike npm and yarn, by default pnpm does not allow your source code to access dependencies that have not been added to your project as dependencies. + ## Supported TypeScript Versions | better-typescript-lib | TypeScript |