Skip to content

Commit 35ae5bd

Browse files
committed
build(externals): mark socket-lib imports as external in packageurl-js
Added external marker for @socketregistry/packageurl-js to prevent bundling of @socketsecurity/lib/* imports, which create circular dependencies during the build process. This fixes build errors: - ERROR: Could not resolve "@socketsecurity/lib/types" - ERROR: Could not resolve "@socketsecurity/lib/objects" The packageurl-js package imports from socket-lib, so those imports must be marked as external to avoid circular bundling issues.
1 parent 204f271 commit 35ae5bd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/build-externals/esbuild-config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ export function getPackageSpecificOptions(packageName) {
2222
} else if (packageName.startsWith('@inquirer/')) {
2323
// Inquirer packages have heavy dependencies we might not need.
2424
opts.external = [...(opts.external || []), 'rxjs/operators']
25+
} else if (packageName === '@socketregistry/packageurl-js') {
26+
// packageurl-js imports from socket-lib, creating a circular dependency.
27+
// Mark socket-lib imports as external to avoid bundling issues.
28+
opts.external = [...(opts.external || []), '@socketsecurity/lib/*']
2529
} else if (packageName === 'yargs-parser') {
2630
// yargs-parser uses import.meta.url which isn't available in CommonJS.
2731
// Replace import.meta.url with __filename wrapped in pathToFileURL.

0 commit comments

Comments
 (0)