Say goodbye to CommonJS and use ESM! 👋

Поделиться
HTML-код
  • Опубликовано: 23 авг 2024

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

  • @TypeScriptTV
    @TypeScriptTV  2 месяца назад

    For a mimic of __dirname and __filename, check out "desm" at: github.com/mcollina/desm

    • @TypeScriptTV
      @TypeScriptTV  2 месяца назад

      One more reson to switch to ESM -> The CJS build of Vite got deprecated: vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated

  • @oblakus
    @oblakus 2 месяца назад +1

    Great video! 👍

    • @TypeScriptTV
      @TypeScriptTV  2 месяца назад

      Thanks! If you want to migrate your project from CommonJS to ESM, give ts2esm a try: github.com/bennycode/ts2esm