Description
With tsc --build
we watch input files, config files and output file timestamps to determine if we need to rebuild or not. In past we never checked for module resolution and related files and their timestamps and requiring users to either force build if all inputs and outputs are UpToDate with only change to module resolution related changed. Eg node_modules/@types/someType/packge.json
say exports or imports map or types entry changes.
Recently in anticipation to nodenext resolution changes we added package.json also as part of list of files to check timestamps on. But since it cannot be derived without having program constructed, it meant that we only watch/check their timestamps when we construct program. This means we benefit from this only in watch scenario and that too if program was constructed.
So here are two questions:
- Do we really need to watch/timestamp check
package.json
as now it could change fields that affect the module resolution - If we need to treat
package.json
can we use heuristics or do we need fields. Note that we could store this list in buildinfo but then non incremental programs will have the same issue as there wont be buildinfo to read from?
Options for package.json detection:
a. package.json next to your own tsconfig, and next to any config referenced in references section?
b. @RyanCavanaugh suggested packagejson entry in the tsconfig
c. references section allowspackge.json
but are we allowing tsconfig options in package.json then?
Originally posted by @sheetalkamat in #44935 (comment)