@@ -12,15 +12,15 @@ index 961dd0391a4124de23eba4539fe6f254b866cf27..3424f5387c55442dc796528ab2730c27
1212 readlink(path: string): Promise<string | null>;
1313 isFile(path: string): Promise<boolean>;
1414diff --git a/out/node-file-trace.js b/out/node-file-trace.js
15- index 2ca08aa0bbcef87d67c87ef6b462dbd1079ad76b..5b3d839922577c91a5d999d5268140857a4b4357 100644
15+ index 2ca08aa0bbcef87d67c87ef6b462dbd1079ad76b..2ad9cbd391f612242507a0908b58e5936bbd5bbc 100644
1616--- a/out/node-file-trace.js
1717+++ b/out/node-file-trace.js
1818@@ -91,7 +91,7 @@ class Job {
1919 reasons = new Map();
2020 cachedFileSystem;
2121 remappings = new Map();
2222- constructor({ base = process.cwd(), processCwd, exports, conditions = exports || ['node'], exportsOnly = false, paths = {}, ignore, log = false, mixedModules = false, ts = true, analysis = {}, cache,
23- + constructor({ base = process.cwd(), processCwd, exports, conditions = exports || ['node'], exportsOnly = false, paths = {}, ignore, log = false, mixedModules = false, ts = true, analysis = {}, cache, web = false,
23+ + constructor({ base = process.cwd(), processCwd, exports, conditions = exports || ['node'], exportsOnly = false, paths = {}, ignore, log = false, mixedModules = false, ts = true, analysis = {}, cache, web = false,
2424 // we use a default of 1024 concurrency to balance
2525 // performance and memory usage for fs operations
2626 fileIOConcurrency = 1024, }) {
@@ -33,17 +33,17 @@ index 2ca08aa0bbcef87d67c87ef6b462dbd1079ad76b..5b3d839922577c91a5d999d526814085
3333 this.analysis = {};
3434 if (analysis !== false) {
3535diff --git a/out/resolve-dependency.js b/out/resolve-dependency.js
36- index 23875e30dd78967b28607e1f63c158876aee343c..4e85fd4e0ce73a797a4358c971f8a87a2f898a11 100644
36+ index 1fb9ee9d388e20de7283520d61ac86fa259ac2b6..6647a929629e4130c161b38edbc564e0e0ebf4a4 100644
3737--- a/out/resolve-dependency.js
3838+++ b/out/resolve-dependency.js
39- @@ -71 ,9 +71 ,10 @@ async function resolveDir(path, parent, job) {
39+ @@ -72 ,9 +72 ,10 @@ async function resolveDir(path, parent, job) {
4040 if (!(await job.isDir(path)))
4141 return;
4242 const pkgCfg = await getPkgCfg(path, job);
4343- if (pkgCfg && typeof pkgCfg.main === 'string') {
4444- const resolved = (await resolveFile((0, path_1.resolve)(path, pkgCfg.main), parent, job)) ||
4545- (await resolveFile((0, path_1.resolve)(path, pkgCfg.main, 'index'), parent, job));
46- + if (pkgCfg && ((job.web && (typeof pkgCfg.browser === 'string' || typeof pkgCfg.module === 'string')) || typeof pkgCfg.main === 'string')) {
46+ + if (pkgCfg && ((job.web && (typeof pkgCfg.browser === 'string' || typeof pkgCfg.module === 'string')) || typeof pkgCfg.main === 'string')) {
4747+ const fieldValue = job.web ? (typeof pkgCfg.browser === 'string' ? pkgCfg.browser : pkgCfg.web): pkgCfg.main;
4848+ const resolved = (await resolveFile((0, path_1.resolve)(path, fieldValue), parent, job)) ||
4949+ (await resolveFile((0, path_1.resolve)(path, fieldValue, 'index'), parent, job));
0 commit comments