From 9e71877d914a6a1d1de1ab699d171f958853e70e Mon Sep 17 00:00:00 2001 From: DidaS Date: Mon, 23 Sep 2024 16:14:46 +0100 Subject: [PATCH] Add `paths` tag for questions regarding tsconfig paths not working (#38) Maybe there is more information that could be added? I just pasted this from the "paths are not magic" tag in the typescript server --- data/tags/paths.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 data/tags/paths.md diff --git a/data/tags/paths.md b/data/tags/paths.md new file mode 100644 index 0000000..26cac14 --- /dev/null +++ b/data/tags/paths.md @@ -0,0 +1,12 @@ +--- +question: How to use tsconfig paths? +keywords: + - "paths" + - "baseUrl" + - "magic" +--- + +The `paths` and `baseUrl` compiler options don't cause any remapping of imports paths, they only inform TS of existing mappings, which you'll have to setup with some other tool. + +`baseUrl` is a pretty well-supported option (e.g. using the `NODE_PATH` environment variable with node or `resolve.modules` with webpack). +`paths` can be trickier to setup, (see [this](https://nodejs.org/api/packages.html#packages_subpath_imports)), and you may find it to not be worth the effort. \ No newline at end of file