Diving into how @babel/register works

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ธ.ค. 2024

ความคิดเห็น • 7

  • @user-jt7wb3zc1m
    @user-jt7wb3zc1m 6 ปีที่แล้ว +1

    Congratulations with 10K followers! Thank you for your amazing work!

  • @HarrySolovay
    @HarrySolovay 6 ปีที่แล้ว +1

    Semi-random question: what're your thoughts on using ts-node in production?

    • @mukeshsoni
      @mukeshsoni 6 ปีที่แล้ว +1

      We use ts-node in production in our company. Haven't had any problems yet. What exactly do you want to know?

    • @HarrySolovay
      @HarrySolovay 6 ปีที่แล้ว

      @@mukeshsoni I'm wondering how using `ts-node/register` compares to `@babel/register` + `@babel/preset-typescript` (other than the optional runtime typechecking). Any other thoughts you have on `ts-node` would be greatly appreciated!

    • @mukeshsoni
      @mukeshsoni 6 ปีที่แล้ว

      @@HarrySolovay Ah, we never tried the `@babel/preset-typescript` option, so can't comment on that.
      Our node code is written in javascript and client code is written in typescript. We do server rendering and so `require` the client code from the server. Which is where we just dropped in `ts-node` and it worked with a few tweaks for syncing typescript config across client and `ts-node`.

    • @HarrySolovay
      @HarrySolovay 6 ปีที่แล้ว

      @@mukeshsoni Gotcha. Such a cool way of doing things.

  • @juliab9515
    @juliab9515 4 ปีที่แล้ว

    Great example. Just saved my project :)