Skip to content

Commit

Permalink
fix: use wpathToFileURL to fix windows imports
Browse files Browse the repository at this point in the history
  • Loading branch information
DorianMazur committed Jul 31, 2024
1 parent 222d422 commit e8c939f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"use strict"

const path = require("node:path")
const { pathToFileURL } = require("node:url")
const fs = require("node:fs")
const process = require("node:process")

Expand Down Expand Up @@ -90,7 +91,7 @@ async function _tryAwaitImport(file, extension) {

if (fs.existsSync(pathAwaitImport)) {
// eslint-disable-next-line no-return-await
return await import(pathAwaitImport)
return await import(pathToFileURL(pathAwaitImport).href)
}

return undefined
Expand Down

0 comments on commit e8c939f

Please sign in to comment.