VSCode does not recognize workspace import event though esbuild does

34 views Asked by At

I have a few projects that use workspaces, and in some VSCode recognizes imports from them fine, and in some just refuses. I have not found errors in logs or could pinpoint the reason.

I tried finding workarounds by using tsconfig, and path aliases looked like a good candidate. Unfortunately any example I could find was dealing with aliases inside the project.

1

There are 1 answers

0
Davor Hrg On

This helped me solve the problem. I am curious if there are better ways, but I do not have a nice simple repro of the issue.

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@org/module1": ["../module1/index.js"],
      "@org/module2": ["../module2/index.js"]
    }
  }
}

I do not use tsc to compile so I can't tell about side-effects.