Skip to content

Commit

Permalink
fix: handle multiple node_modules folders determining mainFilename fo…
Browse files Browse the repository at this point in the history
…r ESM (#2123)

Co-authored-by: Landon Yarrington <[email protected]>
Co-authored-by: Benjamin E. Coe <[email protected]>
  • Loading branch information
3 people authored May 14, 2022
1 parent b42e0ca commit e0823dd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/platform-shims/esm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ try {
} catch (e) {
__dirname = process.cwd();
}
const mainFilename = __dirname.split('node_modules')[0]
const mainFilename = __dirname.substring(0, __dirname.lastIndexOf('node_modules'));

export default {
assert: {
Expand Down

0 comments on commit e0823dd

Please sign in to comment.