support the "module" field in package.json files

This commit is contained in:
Erik Krogh Kristensen
2021-08-30 11:05:32 +02:00
parent bf15b18f22
commit 486b283c20
5 changed files with 20 additions and 1 deletions

View File

@@ -146,7 +146,7 @@ private string getASrcFolderName() { result = ["ts", "js", "src", "lib"] }
class MainModulePath extends PathExpr, @json_string {
PackageJSON pkg;
MainModulePath() { this = pkg.getPropValue("main") }
MainModulePath() { this = pkg.getPropValue(["main", "module"]) }
/** Gets the `package.json` file in which this path occurs. */
PackageJSON getPackageJSON() { result = pkg }