mirror of
https://github.com/grpc/grpc-node.git
synced 2025-12-08 18:23:54 +00:00
proto loader: Fall back to default path resolution
This commit is contained in:
parent
db205a82b6
commit
a6ecc7c8c8
@ -118,6 +118,7 @@ function createPackageDefinition(root: Protobuf.Root, options: Options): Package
|
||||
}
|
||||
|
||||
function addIncludePathResolver(root: Protobuf.Root, includePaths: string[]) {
|
||||
const originalResolvePath = root.resolvePath;
|
||||
root.resolvePath = (origin: string, target: string) => {
|
||||
if (path.isAbsolute(target)) {
|
||||
return target;
|
||||
@ -131,7 +132,7 @@ function addIncludePathResolver(root: Protobuf.Root, includePaths: string[]) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
throw new Error(`Could not find file ${target}`);
|
||||
return originalResolvePath(origin, target);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user