improve node_modules as externals handling (#3736)
Run after_resolve with original request
try to resolve original request with node.js options to determine if it can be external
typescript extends need to resolve with bare node.js resolving to avoid custom resolve options
add special pnpm logic to improve externals when pnpm is used