microsoft / microsoft/TypeScript
compilerOptions.paths to support relative and absolute paths
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript Version: 2.0.2
Code
{
"compilerOptions": {
"paths": {
"./moment": ["node_modules/moment/moment.d.ts"],
"/foo/bar/baz": [ "some/other/path/for/compiler"]
}
},
Expected behavior:
I expect (need) to be able to redirect the compiler for any module, not just 'non relative' paths. I'm deploying to a runtime environment that requires me to use relative or absolute paths, but I need the compiler to look to different locations when building locally.
Actual behavior:
The compiler seems to ignore any compilerOption.paths setting which starts with / or ./
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the provided compilerOptions.paths configuration and the relative and absolute module keys. Trace the compiler's path-resolution entry point to determine why those keys are ignored. Done means relative and absolute paths are redirected as described while existing non-relative path behavior remains intact.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100