From 275df47fcf43140fb6953bb45c2f0de751f28ddd Mon Sep 17 00:00:00 2001 From: Nikita Skovoroda Date: Sun, 7 Jul 2024 15:54:53 +0300 Subject: [PATCH] fix: loading esm-register via full path from a different cwd --- packages/register/esm-register.mts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/register/esm-register.mts b/packages/register/esm-register.mts index 8edbcc65d..497c3cecb 100644 --- a/packages/register/esm-register.mts +++ b/packages/register/esm-register.mts @@ -1,4 +1,3 @@ -import { register } from 'node:module' -import { pathToFileURL } from 'node:url' +import { register } from 'node:module'; -register('@swc-node/register/esm', pathToFileURL('./').toString()) +register('@swc-node/register/esm', import.meta.url)