Skip to content

Build mode output is not regenerated after being deleted from the filesystem #57709

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dsogari opened this issue Mar 9, 2024 · 2 comments
Closed

Comments

@dsogari
Copy link

dsogari commented Mar 9, 2024

πŸ”Ž Search Terms

build, mode, output

πŸ•— Version & Regression Information

  • I'm using the latest version as of now (5.4.2)
  • I did not have time to look for previous versions

⏯ Playground Link

No response

πŸ’» Code

Running tsc -b on a project whose output has been deleted from disk does not regenerate that output. For example, if my project is a directory containing an empty test.ts file and a tsconfig.json like the following:

{
  "compilerOptions": {
    "incremental": true,
    "skipLibCheck": true,
    "tsBuildInfoFile": ".tsbuildinfo",
  }
}

Running tsc -b . the first time produces the file test.js. If I delete that file and run the command again, nothing happens. If I edit the source and run the command again, then the test.js file is generated as expected.

This applies to .d.ts and .map files as well. Additionally, if output directories are specified, like so:

{
  "compilerOptions": {
    // same as above, plus
    "outDir": "./lib",
    "declarationDir": "./types",
    "declaration": true,
    "declarationMap": true,
  }
}

Then the .d.ts file does not get regenerated (after being deleted from disk) even if I edit the source file.

πŸ™ Actual behavior

The output files do not get regenerated after being deleted from disk.

πŸ™‚ Expected behavior

I'd expect alll output files to be regenerated after being deleted from disk.

Additional information about the issue

No response

@MartinJohns
Copy link
Contributor

Duplicate of #30602.

@dsogari
Copy link
Author

dsogari commented Mar 9, 2024

Thanks!

@dsogari dsogari closed this as completed Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants