Skip to content

feat: add tsconfig "paths" alias resolution (with tests)#1211

Merged
ShiboSoftwareDev merged 6 commits intotscircuit:mainfrom
ShiboSoftwareDev:main
Oct 9, 2025
Merged

feat: add tsconfig "paths" alias resolution (with tests)#1211
ShiboSoftwareDev merged 6 commits intotscircuit:mainfrom
ShiboSoftwareDev:main

Conversation

@ShiboSoftwareDev
Copy link
Copy Markdown
Contributor

• Resolve non-relative imports using tsconfig.json compilerOptions.baseUrl and
paths when provided in fsMap
• Supports wildcard and exact aliases (e.g., @src/, @utils/) with extension
fallback (.ts, .tsx, .js, .jsx, .json, .obj, .gltf, .glb)
• Works across runner and webworker; maps original alias to resolved module in
preSuppliedImports
• Added test: tests/features/tsconfig-paths-resolution.test.tsx
• No breaking changes; node_modules and static asset resolution remain unchanged

Usage:

• Include a tsconfig.json in your fsMap: { "compilerOptions": { "baseUrl": ".",
"paths": { "@src/": ["src/"] } } }
• Then import via aliases (e.g., import Comp from "@src/component")

/fixes #1204
/claim #1204

Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor comments, but i think the bun-test.yml thing is coincidental, i'm merging a different fix for it

@ShiboSoftwareDev ShiboSoftwareDev merged commit 50b7e3b into tscircuit:main Oct 9, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for tsconfig "paths"

2 participants