TypeStrong / TypeStrong/ts-loader
Incremental builds not working
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 3.5k
- Forks
- 439
- Avg merge
- 17h 17m
- Merged PRs (30d)
- 2
Description
Expected Behaviour
When tsconfig has the incremental compiler option set to true, a '.tsbuildinfo' file should be produced alongside the built *.js files in order to enable tsc to perform incremental builds.
Actual Behaviour
Not only is no '.tsbuildinfo' file produced, but no TypeScript build artifacts at all are produced. The outDir in tsconfig appears to be entirely ignored. The only output is the Webpack bundle, as specified by output.path.
Additionally, even if no changes have been made to any files, the compilation process still takes >15 seconds.
If I run tsc directly, the outDir (including .tsbuildinfo) is produced as expected.
Where does the output of tsc go? Clearly it's somewhere, because Webpack is able to read it to produce the bundle. But it doesn't seem to be persisted between builds.
Steps to Reproduce the Problem
- Set
outDirto"./build/"in tsconfig.json. - Set
incrementaltotruein tsconfig.json. - Set
output.pathtopath.resolve(__dirname, "dist")in webpack.config.js. - Run webpack. Observe that no
.tsbuildinfofile is produced.
Location of a Minimal Repository that Demonstrates the Issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the referenced minimal repository, using tsconfig.json with incremental and outDir alongside webpack.config.js with output.path, then inspect how ts-loader passes TypeScript output to Webpack. Done means webpack produces the expected JavaScript files and persists .tsbuildinfo so unchanged builds can use incremental compilation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, webpack
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100