Skip to content

Commit 96019eb

Browse files
committed
fix: true require detection logic
1 parent 3f39c6a commit 96019eb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const fs = require('fs-extra')
88
const fileModuleNamePattern = /^[./]/
99
const packageNamePattern = /^(@(.+?)\/)?([^/]+)/
1010

11-
const isTrueRequire = path => path.scope.getBindings().require == null
11+
const isTrueRequire = path => path.scope.lookup('require') == null
1212

1313
async function buildImportList(startingFiles) {
1414
if (typeof startingFiles === 'string') startingFiles = [startingFiles]

0 commit comments

Comments
 (0)