Skip to content
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

Only transforms if relative to first path in the array #60

Closed
nonara opened this issue Jul 29, 2020 · 0 comments · Fixed by #61
Closed

Only transforms if relative to first path in the array #60

nonara opened this issue Jul 29, 2020 · 0 comments · Fixed by #61
Labels
Bug Something isn't working

Comments

@nonara
Copy link
Collaborator

nonara commented Jul 29, 2020

Example

./index.ts

import { v1 } from "#path/b"  // Resolves to ./a.ts
import { v2 } from "#path/a"  // Resolves to ./dir2/b.ts

export { v1, v2 }

./tsconfig.json

{
  "compilerOptions": {
    // ...
    "baseUrl": ".",
    "paths": {
      "#path/*": [ "./*", "./dir2/*" ]
    },
    "plugins": [
      {
        "transform": "typescript-transform-paths"
      }
    ]
  }
}

Output: index.js (I used ESNext for readability, but happens with CommonJS as well)

import { gg } from "#path/b";  // Does not transform because it's the second path in the array
import { ga } from "./a";
export { gg, ga };
@danielpza danielpza added the Bug Something isn't working label Jul 30, 2020
danielpza pushed a commit that referenced this issue Jul 30, 2020
* Multiple Issue Fixes

- Allow more than one path routing (fixes #60)
- Remove implicit extensions from output (fixes #24)
- Properly implemented isTypeOnly (fixes #48)
- Corrected errors in tests due to TS changing logic for type only star exports
- Bonus: Made package zero-dependency

* Removed accidental dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants