Comments (8)
This is expected behavior.
A TypeScript compilation—which is happening at runtime in this case—, cannot load more than one tsconfig.json
at once. I imagine esr is looking up a tsconfig.json
for each file, but that's expensive and also not correct behavior.
I verified that tsx's behavior is consistent with ts-node
.
from tsx.
@privatenumber But this is not consistent with esbuild itself! In the reproduction repo:
❯ p esbuild test.ts --bundle > test.js
❯ cat test.js
"use strict";
(() => {
// ../b/lib.ts
console.log("imported lib");
})();
❯ node test.js
imported lib
So it's possible to build a production build with these aliases but not run it in dev mode with tsx
? Please reconsider your decision.
from tsx.
@privatenumber thoughts?
from tsx.
Curious how esbuild works if setting a different tsconfig path?
https://esbuild.github.io/api/#tsconfig
from tsx.
@privatenumber esbuild supports multiple tsconfig.json from referenced folders - same as I would expect from tsx.
This is explicitly stated by Evan, e.g.:
- evanw/esbuild#277 (comment): "different directories can take their settings from different tsconfig.json files with esbuild"
- https://pullanswer.com/questions/esbuild-resolves-modules-by-using-the-typescript-modulesuffixes-per-package-instead-of-per-bundle#711300: "This is why esbuild supports multiple tsconfig.json files: because each folder with a tsconfig.json file in it is conceptually a thing that you would traditionally run tsc in for each one before bundling."
from tsx.
How does it handle custom tsconfig.json
paths via the tsconfig
CLI flag for multiple projects?
e.g. If project A uses tsconfig.a.json
and its dependency project B uses tsconfig.b.json
, how is it configured?
from tsx.
I'm not following how is that related to the case. From what I've quickly gathered, there's no esbuild API option to provide different custom named tsconfig's for different projects. Why would that matter?
from tsx.
In case the uncompiled dependency project has a custom tsconfig (eg. with paths
configured).
I'm going to lock this thread in favor of #96 since this one is already closed.
from tsx.
Related Issues (20)
- Use ESBuild config HOT 2
- Printing error from esbuild can fail HOT 7
- `require()` of malformed script uncatchably crashes the process HOT 6
- No event fired in watch mode
- Dynamic `import()` in a CJS file can execute a module twice HOT 3
- Does not work with JSX out of the box in a Next.js project HOT 9
- is there an option to watch html and css files?
- Property not assigned to child class when set by parent HOT 3
- VS Code breakpoint with tsx and Nodejs 20.12.0 does not work HOT 20
- The argument 'methodName' must be a method. Received undefined HOT 7
- Tsx ignores type commonjs in package.json HOT 1
- Add extra files to watch HOT 1
- Environment variables support HOT 5
- Typescript REPL HOT 1
- Multiline input in Typescript REPL
- Feature request: Extend 'tsx watch' for run command on detects file changes HOT 2
- Parse error when using classes and complicated hashbangs
- Script not running when node=21, type="module", watchmode is enabled, is importing from "node:process" and using turborepo HOT 1
- Support `--input-type=ts` HOT 2
- tsx can't run code with endent HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tsx.