Skip to content

refactor(@ngtools/webpack): support optional baseUrl with tsconfig paths#32646

Merged
clydin merged 1 commit intoangular:mainfrom
clydin:webpack/paths-base-url
Mar 2, 2026
Merged

refactor(@ngtools/webpack): support optional baseUrl with tsconfig paths#32646
clydin merged 1 commit intoangular:mainfrom
clydin:webpack/paths-base-url

Conversation

@clydin
Copy link
Member

@clydin clydin commented Mar 2, 2026

The Webpack plugin now ensures a baseUrl is set when paths are present, using the pathsBasePath as a fallback. This makes the baseUrl property optional in tsconfig.json files when paths are used.

This commit also refactors several tests to remove their reliance on a pre-existing baseUrl. The tests now programmatically add paths to the tsconfig.json to avoid brittle string replacements. The test project's base tsconfig.json has also been updated to remove the now optional baseUrl.

@clydin clydin added the target: major This PR is targeted for the next major release label Mar 2, 2026
@clydin clydin force-pushed the webpack/paths-base-url branch from df88ffe to da0d775 Compare March 2, 2026 19:47
The Webpack plugin now ensures a `baseUrl` is set when `paths` are present, using the `pathsBasePath` as a fallback. This makes the `baseUrl` property optional in `tsconfig.json` files when `paths` are used.

This commit also refactors several tests to remove their reliance on a pre-existing `baseUrl`. The tests now programmatically add `paths` to the `tsconfig.json` to avoid brittle string replacements. The test project's base `tsconfig.json` has also been updated to remove the now optional `baseUrl`.
@clydin clydin force-pushed the webpack/paths-base-url branch from da0d775 to 83e9d35 Compare March 2, 2026 20:00
@clydin clydin marked this pull request as ready for review March 2, 2026 20:08
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Mar 2, 2026
@clydin clydin requested a review from alan-agius4 March 2, 2026 20:09
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 2, 2026
@clydin clydin merged commit b47078f into angular:main Mar 2, 2026
37 checks passed
@clydin
Copy link
Member Author

clydin commented Mar 2, 2026

This PR was merged into the repository. The changes were merged into the following branches:

@clydin clydin deleted the webpack/paths-base-url branch March 2, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @ngtools/webpack target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants