Explorar el Código

refactor: improve file path resolution (#55)

Kaine hace 2 años
padre
commit
48e8f2c196
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      playground/setup/dev.js

+ 2 - 1
playground/setup/dev.js

@@ -1,7 +1,8 @@
 // @ts-check
 import path from 'node:path'
+import { fileURLToPath } from 'node:url'
 
-const dirname = path.dirname(new URL(import.meta.url).pathname)
+const dirname = path.dirname(fileURLToPath(new URL(import.meta.url)))
 const resolve = (/** @type {string} */ p) =>
   path.resolve(dirname, '../../packages', p)