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

TS Module imports should use tsconfig path map #31

Open
machuu opened this issue Nov 18, 2019 · 0 comments
Open

TS Module imports should use tsconfig path map #31

machuu opened this issue Nov 18, 2019 · 0 comments

Comments

@machuu
Copy link
Owner

machuu commented Nov 18, 2019

tsconfig.json can map paths within the project directory tree. TS Handbook path-mapping

In this project, the first place I want to use this is test files.

Currently, to import a TS module from src/ directory, I have to use

import { Card } from "../src/card"

Adding something like:

"basedir": ".",
"paths": {
  "~src": ["src"],
  "~test": ["test"]
}

would let me import files in <project root>/src, like:

import { Card } from "~src/card"

from any depth in the project directory.

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

No branches or pull requests

1 participant