There's no underscore underscore, surname, no underscore underscore file name. You have to define this every single time in your file or you can make a function that passes import meta URL. TypeScript is the goat here, because it is in a space where you can mix and match the two. I wanted to first move to 100% to ESM before I did the full TypeScript rewrite. It's so much clearer. But TypeScript makes a lot of this much, much easier for you.
In this episode of Syntax, Wes and Scott talk through what ESM is, and why you want to move your projects to ESM.
Sentry - Sponsor
If you want to know what’s happening with your code, track errors and monitor performance with Sentry. Sentry’s Application Monitoring platform helps developers see performance issues, fix errors faster, and optimize their code health. Cut your time on error resolution from hours to minutes. It works with any language and integrates with dozens of other services. Syntax listeners new to Sentry can get two months for free by visiting Sentry.io and using the coupon code TASTYTREAT during sign up.
Show Notes
××× SIIIIICK ××× PIIIICKS ×××
Shameless Plugs
Tweet us your tasty treats