b3860c0cc7
Packages like @secure-exec/v8 distribute platform-specific native binaries via optionalDependencies (e.g. @secure-exec/v8-darwin-arm64). These packages use createRequire(import.meta.url).resolve() at runtime to locate the correct platform binary, which breaks when esbuild bundles them because import.meta.url then points to the bundle output directory. Add a heuristic to the auto-external detection that checks if a package has optionalDependencies with platform-specific names (darwin, linux, win32, etc.). When 2+ such deps are found, the package is marked as external so it resolves binaries from its real node_modules location. https://claude.ai/code/session_01ScLShmDQ92z8bY9A2T1cPB