Created by: entropitor
Fixes #10796 Fixes #9373 (closed) Fixes #8551
Typescript project references are a useful feature in a monorepo that allow building sub-packages incrementally and don't require a rebuild of a dependency to get up-to date type information in the editor of that dependency.
However, for it to work, some fields need to be set in the tsconfig: composite: true, incremental: true, emitDeclarationOnly: true
the last one is a problem because typescript errors when there is a field for noEmit
and for emitDeclarationOnly
. This PR inspect the users' config, and if they already have a emitDeclarationOnly
, it needs to be set to the value true and if they don't the current behaviour is kept.
I've tried copying this file to my local project's node_modules and now I can add emitDeclarationOnly
without a problem (and thus without react-scripts overwriting my tsconfig)