8000 TS Module imports should use tsconfig path map · Issue #31 · machuu/writing-app · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

TS Module imports should use tsconfig path map #31

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 agr 7FD3 ee 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
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
0