Create node_modules
folder under your src
, then put typings of module(s) you want to overwrite inside:
├── node_modules
│ └── ...
│
└── src
├── index.ts
├── ... your codes ...
│
└── node_modules
└── <module-to-be-overwritten>
└── index.d.ts
No need to modify compilerOptions
in tsconfig.json.
Read How TypeScript resolves modules section in https://www.typescriptlang.org/docs/handbook/module-resolution.html.