What is TypeScript esModuleInterop and why you should set it

Поделиться
HTML-код
  • Опубликовано: 23 авг 2024
  • In this lesson we look at the #TypeScript #ESModuleInterop compiler option.
    We discuss the reason why it exists and why you should set it.
    In the end we also cover the standard way of import Native and #NPM #NodeJS modules in #JavaScript / #TypeScript 🌹
    PS: link to the survey: / 1251026587669024768
    👇 SUBSCRIBE TO MY RUclips CHANNEL 👇
    www.youtube.co...
    *Feel Free To Read This Lot*
    I'm Basarat, That TypeScript Guy and I love helping developers. More about me:
    Microsoft MVP for TypeScript
    Lead Frontend Practice at Australia Post
    Creator designtsx.com
    150K contributions on Stackoverflow. Top Contributor for TypeScript.
    Book Author : Beginning NodeJS
    Book Author : TypeScript Deep Dive
    Egghead Instructor : egghead.io/ins...
    Creator of multiple hot ✨ed Github Open Source projects
    Follow me on twitter: / basarat
    Follow me on github: github.com/bas...
    Donate: www.paypal.me/...
    Website: basarat.com/

Комментарии • 6

  • @apdy27
    @apdy27 Год назад

    thank you! very clean and concise!

  • @ononaoyaa
    @ononaoyaa 4 года назад +2

    Thank you! Would love to see a video about how the `infer` keyword works

  • @saralissette6235
    @saralissette6235 4 года назад +1

    Thanks for your work. Nice!

  • @abdelelmedny4025
    @abdelelmedny4025 3 года назад

    Excellent explanation, thanks and keep it up!

  • @lorentzimys
    @lorentzimys 2 года назад

    thanks a lot!

  • @franklemanschik_de
    @franklemanschik_de 2 года назад +1

    Uff ok you showed the effect but you did not even cover allowSyntactic imports and you also showed that interOp turns that on by default but thats the wrong topic here. esModuleInterop is a typescript helper that gives you the default property of CJS modules and allowSyntheticDefaultImports is what makes the conversation from * to Namespace