-
-
Notifications
You must be signed in to change notification settings - Fork 154
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
Apply rootDir/outDir when resolving imports #603
Comments
When I run
With
Am I missing something? |
If I understand the repro correctly, it doesn't make sense to compile the files at the root level, since it's a monorepo and each workspace inside should be compiled independently since they are independent projects in the same repo. In this case before you compile (or type check) the files in the workspace Leaving aside the compilation process, it's important to note that when |
Yes, what @gaastonsr said is correct. In this example If you open this project in an IDE (e.g. VSCode with the Typescript extension), all the language servers work and the resulting compiled code also runs in Node.js. The ask here is that |
Acknowledgements
Minimal reproduction URL
https://github.com/JavaScriptBach/ts-repo-structure
Problem & expected behavior (under 200 words)
The Problem
I have a Typescript monorepo with source files in
<package>/src/*.ts
and js files outputted to<package>/dist/*.js
. Each package also usesimports
andexports
in the package.json to control entry points and allow for bare imports. A small repro is linked below.This configuration works perfectly in Typescript and Node, but not in
tsx
.tsx
is NOT able to run this code before it's compiled.I think the key missing section is here. It looks like we did some extension remapping in #59, but I think we also need handle
rootDir
andoutDir
to have full parity with Typescript.Repro
yarn
npx tsx a/src/a.ts
Bugs are expected to be fixed by those affected by it
Compensating engineering work will speed up resolution and support the project
The text was updated successfully, but these errors were encountered: