diff --git a/src/index.js b/src/index.js index 60efde4..9de8740 100644 --- a/src/index.js +++ b/src/index.js @@ -42,6 +42,7 @@ class ExportFinder { this.path = path this.hasExportDefault = false this.hasExportNamed = false + this.hasModuleExports = false } getRootPath () { return this.path.parentPath.parentPath @@ -56,7 +57,7 @@ class ExportFinder { } } }) - return this.hasExportDefault && !this.hasExportNamed + return this.hasExportDefault && !this.hasExportNamed && !this.hasModuleExports } findExport (path, property = 'expression') { // Not `exports.anything`, skip @@ -73,6 +74,9 @@ class ExportFinder { this.hasExportNamed = true } } + if (`${objectName}.${propertyName}` === 'module.exports') { + this.hasModuleExports = true + } return null } }