public static SourceFileModule resolve(File rootDir, File dir, String target) throws IOException, JSONException {
        // NOTE(Zhen): Ignore CoreModule for now to enable a more flexible semantic modeling
        // if (NodejsRequiredCoreModule.isCoreModule(target)) return NodejsRequiredCoreModule.make(target);
        if (target.startsWith("./") || target.startsWith("/") || target.startsWith("../")) {
            SourceFileModule module = loadAsFile(rootDir, new File(dir, target));
            if (module != null) return module;
            module = loadAsDirectory(rootDir, new File(dir, target));
            if (module != null) return module;
        }
        // NOTE(Zhen): it is not very useful to throw exception...
        return loadNodeModules(rootDir, dir, target);
    }
public static SourceFileModule resolve(File rootDir, File dir, String target) throws IOException, JSONException {
       
       
        if (target.startsWith("./") || target.startsWith("/") || target.startsWith("../")) {
            SourceFileModule module = loadAsFile(rootDir, new File(dir, target));
            if (module != null) return module;
            module = loadAsDirectory(rootDir, new File(dir, target));
            if (module != null) return module;
        }
       
        return loadNodeModules(rootDir, dir, target);
    }
public static sourcefilemodule resolve(file rootdir, file dir, string target) throws ioexception, jsonexception { if (target.startswith("./") || target.startswith("/") || target.startswith("../")) { sourcefilemodule module = loadasfile(rootdir, new file(dir, target)); if (module != null) return module; module = loadasdirectory(rootdir, new file(dir, target)); if (module != null) return module; } return loadnodemodules(rootdir, dir, target); }