Skip to content

Commit e0823dd

Browse files
jopemachinejly36963bcoe
authored
fix: handle multiple node_modules folders determining mainFilename for ESM (#2123)
Co-authored-by: Landon Yarrington <[email protected]> Co-authored-by: Benjamin E. Coe <[email protected]>
1 parent b42e0ca commit e0823dd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/platform-shims/esm.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ try {
2121
} catch (e) {
2222
__dirname = process.cwd();
2323
}
24-
const mainFilename = __dirname.split('node_modules')[0]
24+
const mainFilename = __dirname.substring(0, __dirname.lastIndexOf('node_modules'));
2525

2626
export default {
2727
assert: {

0 commit comments

Comments
 (0)