We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72cbb6b commit dad4b36Copy full SHA for dad4b36
build.mjs
@@ -46,10 +46,11 @@ function patchCjsInterop() {
46
let code = [
47
`import {createRequire} from 'module'`,
48
`import {dirname as __global__dirname__} from 'path'`,
49
+ `import {fileURLToPath} from 'url'`,
50
51
// CJS interop fixes
52
`const require=createRequire(import.meta.url)`,
- `const __filename=new URL(import.meta.url).pathname`,
53
+ `const __filename=fileURLToPath(import.meta.url)`,
54
`const __dirname=__global__dirname__(__filename)`,
55
]
56
0 commit comments