Skip to content

fix!: paths match align with tsconfig-paths-webpack-plugin#74

Merged
stormslowly merged 2 commits into
mainfrom
fix/align_paths_match_with_tsconfig_paths
May 28, 2025
Merged

fix!: paths match align with tsconfig-paths-webpack-plugin#74
stormslowly merged 2 commits into
mainfrom
fix/align_paths_match_with_tsconfig_paths

Conversation

@stormslowly
Copy link
Copy Markdown
Collaborator

@stormslowly stormslowly commented May 28, 2025

⚠️ Note
This PR will introduce Breaking Change‼️

When there is no references configed, take the demo repo struct as an example.
app uses codes from project-a, they both config paths as "foo": ["./mock_foo"] in tsconfig.json

├── app
│   ├── mock_foo
│   │   └── index.js
│   ├── src
│   │   └── index.ts
│   ├── tsconfig.json
│   └── webpack.config.js
└── project-a
    ├── index.js
    ├── mock_foo
    │   └── index.js
    ├── src
    │   └── index.ts
    └── tsconfig.json

before

paths alias takes effect on files under project folder only.
for example
in app/src/index.ts, resolve "foo" will return app/mock_foo/index.js
in project-a/src/index.ts, resolve "foo" will return NotFound Error
see the example in spack_resolver_demo.js in demo repo

after

paths alias takes effect on all files. (tsconfig-paths-webpack-plugin dose so)
take previous exmaple, resolving "foo" in project-a/src/index.ts will return app/mock_foo/index.ts.

close: #74

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 28, 2025

CodSpeed Performance Report

Merging #74 will not alter performance

Comparing fix/align_paths_match_with_tsconfig_paths (806438d) with main (1ab1bd9)

Summary

✅ 3 untouched benchmarks

@hardfist
Copy link
Copy Markdown
Contributor

this is a breaking change and should add breaking notice in description, and also please add reference to the semantic description of tsc and webpack-tsconfig-paths-plugins

@stormslowly stormslowly changed the title fix: paths match align with tsconfig-paths-webpack-plugin fix!: paths match align with tsconfig-paths-webpack-plugin May 28, 2025
@stormslowly stormslowly merged commit ab961d2 into main May 28, 2025
21 checks passed
@stormslowly stormslowly deleted the fix/align_paths_match_with_tsconfig_paths branch May 28, 2025 17:32
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

Successfully merging this pull request may close these issues.

2 participants