In the process of developing module A, I have implemented a feature where users can choose to inject a Winston logger into my module. As a result, winston
becomes a peer dependency.
However, when attempting to include module A in another module without the need for logging (therefore excluding Winston) and compiling with tsc
, TypeScript raises an error:
The module 'winston' or its corresponding type declarations cannot be found.
What is the recommended solution for this issue?