Open
Description
π Search Terms
tsc build watch extra unwanted stray .js .js.map files projects
π Version & Regression Information
- This changed between versions 5.5 and 5.6
β― Playground Link
No response
π» Code
Repo with the repro: https://github.com/echentw/tsc-watch-bug-repro
- Instructions for repro-ing are under "Bug 1 repro instructions".
Description of the repro:
- The setup:
- The repo contains 2 TS projects:
project1
andproject2
- The
.js
and.js.map
files should be outputted toproject1/dist/
andproject2/dist/
project1
defines some math functions thatproject2
imports and uses- The git branches:
- the
main
branch has the base code - the
multiply-function
branch has one additional commit on top ofmain
, which:- adds a
project1/src/multiply.ts
file which exports amultiply
function - and edits
project2/src/main.ts
to import and use thatmultiply
function.
- adds a
- the
- The repo contains 2 TS projects:
- When you switch from
main
to themultiply-function
branch whiletsc --build --watch
is running from withinproject2/
, then the following unwanted files are created:project1/src/multiply.js
project1/src/multiply.js.map
I checked that this doesn't happen with TS version 5.5, but it does happen with TS version 5.6 and onwards.
π Actual behavior
project1/src/multiply.js
and project1/src/multiply.js.map
are created
π Expected behavior
project1/src/multiply.js
and project1/src/multiply.js.map
should not be created
Additional information about the issue
Ideally, switching branches or modifying code while tsc --build --watch
is running wouldn't produce stray .js
/.js.map
files. They are unpleasant to deal with and can be accidentally committed.
No response