diff --git a/lib/findJsModulesFor.js b/lib/findJsModulesFor.js
index <HASH>..<HASH> 100644
--- a/lib/findJsModulesFor.js
+++ b/lib/findJsModulesFor.js
@@ -116,6 +116,14 @@ function findJsModulesFor(config, pathToCurrentFile, variableName) {
     });
   });
 
+  config.environmentCoreModules().forEach((dep) => {
+    if (dep.toLowerCase() !== variableName.toLowerCase()) {
+      return;
+    }
+
+    matchedModules.push(new JsModule({ importPath: dep }));
+  });
+
   // Find imports from package.json
   const ignorePrefixes = config.get('ignore_package_prefixes').map(
     (prefix) => escapeRegExp(prefix));
@@ -139,14 +147,6 @@ function findJsModulesFor(config, pathToCurrentFile, variableName) {
     }
   });
 
-  config.environmentCoreModules().forEach((dep) => {
-    if (dep.toLowerCase() !== variableName.toLowerCase()) {
-      return;
-    }
-
-    matchedModules.push(new JsModule({ importPath: dep }));
-  });
-
   // If you have overlapping lookup paths, you might end up seeing the same
   // module to import twice. In order to dedupe these, we remove the module
   // with the longest path
Move finding environmentCoreModules above dependencies

Conceptually these should be considered first, since they are part of
the environment. Furthermore, this is how we group things so it is nice
to have the symmetry here.