-
Notifications
You must be signed in to change notification settings - Fork 8
feat: add dynamic @src alias resolution for consuming apps #158
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
Conversation
00769a8 to
8e2b869
Compare
8e2b869 to
c60f221
Compare
|
I asked ChatGPT to take a look at the diff (I was wondering if there was a simpler way to handle this we were missing). It didn't find a simpler way, but it did make a few suggestions: SummaryThis plugin seems justified — webpack aliases are static and can’t resolve
No built-in enhanced-resolve plugin seems to provide “closest ancestor src wins”, so this approach makes sense overall.
|
|
This approach won't work, essentially because of Typescript. An approach that does work is presented here. |
Description
Replace static @src webpack alias with ClosestSrcResolverPlugin that dynamically resolves @src to the nearest src directory from the importing file. Each consuming app now defines its own @src path in tsconfig.json for TypeScript/IDE support.
LLM usage notice
Created with assistance from Claude Opus 4.5 (session log).