Skip to content

Handle Typescript alias and package.json imports #35

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MacFJA
Copy link

@MacFJA MacFJA commented Mar 7, 2025

Add path mapping for TypeScript and Node

This PR add a path mapping/alias resolution for TypeScript (tsconfig.json: compilerOptions.paths) and node (package.json: imports)

  • Add custom pre-resolver to transform requested path [src/hooks/hooks.mts + src/service/resolve-mapping.ts]
  • Fix issue where configuration from the loaded tsconfig.json are not correctly override (rootDir not defaulted to the directory that contains the tsconfig.json file, same for ts config parser) [src/service/tsconfig.ts]
  • Fix tsconfig.json option paths being removed [src/service/transpile-only.ts]

Reuse PR #24 as base for unit tests


Closes #11 and #12

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.

Subpath imports not working
2 participants