Git Product home page Git Product logo

Comments (8)

privatenumber avatar privatenumber commented on May 17, 2024

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.

IlyaSemenov avatar IlyaSemenov commented on May 17, 2024

@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.

IlyaSemenov avatar IlyaSemenov commented on May 17, 2024

@privatenumber thoughts?

from tsx.

privatenumber avatar privatenumber commented on May 17, 2024

Curious how esbuild works if setting a different tsconfig path?

https://esbuild.github.io/api/#tsconfig

from tsx.

IlyaSemenov avatar IlyaSemenov commented on May 17, 2024

@privatenumber esbuild supports multiple tsconfig.json from referenced folders - same as I would expect from tsx.

This is explicitly stated by Evan, e.g.:

from tsx.

privatenumber avatar privatenumber commented on May 17, 2024

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.

IlyaSemenov avatar IlyaSemenov commented on May 17, 2024

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.

privatenumber avatar privatenumber commented on May 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.