Repository navigation
fix(webpack): resolve tsconfig absolute path - #3595
Merged
kamilmysliwiec merged 1 commit intoSep 25, 2026
Merged
Conversation
The webpack compiler built the tsconfig path with `path.join(cwd, tsConfigPath)`, so an absolute path such as `-p /home/me/app/tsconfig.build.json` became `<cwd>/home/me/app/tsconfig.build.json` and the build failed with "Could not find TypeScript configuration file". The rspack compiler was fixed for this in nestjs#3542 by resolving the path instead and passing the resolved path on to its defaults factory; the webpack compiler was left unchanged. Apply the same change to the webpack compiler.
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
PR Type
What is the current behavior?
Issue Number: N/A
The webpack compiler builds the tsconfig path with
path.join(cwd, tsConfigPath). For an absolute path,joindoes not short-circuit, solooks for
<cwd>/home/me/app/tsconfig.build.jsonand fails withCould not find TypeScript configuration file. The same happens with an absolutecompilerOptions.tsConfigPath.The rspack compiler had exactly this bug and was fixed in #3542 (
fix(rspack): resolve tsconfig absolute path) by usingpath.resolveand passing the resolved path on to its defaults factory. The webpack compiler was left unchanged.What is the new behavior?
The webpack compiler resolves the path the same way and passes the resolved path to
webpackDefaultsFactory, matching rspack. Relative paths behave as before.Tests: the existing factory-arguments test now expects the resolved path, and a new case passes an absolute tsconfig path through unchanged (mirroring the rspack spec). Both fail on
masterand pass with this change.Does this PR introduce a breaking change?