Skip to content

Commit bfd1416

Browse files
committed
add logging when package.json is skipped with esbuild
1 parent 728004d commit bfd1416

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

packages/datadog-esbuild/index.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,21 @@ ${build.initialOptions.banner.js}`
270270
isESM
271271
}
272272
}
273-
} catch {
273+
} catch (e) {
274274
// Skip vendored dependencies which never have a `package.json`. This
275275
// will use the default resolve logic of ESBuild which is what we want
276276
// since those files should be treated as regular files and not modules
277277
// even though they are in a `node_modules` folder.
278+
if (e.code === 'ENOENT') {
279+
if (DEBUG) {
280+
console.log([
281+
'Skipping `package.json` lookup.',
282+
'This usually means the package was vendored but could indicate an issue otherwise.'
283+
].join(' '))
284+
}
285+
} else {
286+
throw e
287+
}
278288
}
279289
}
280290
})

0 commit comments

Comments
 (0)