mirror of https://github.com/grpc/grpc-node.git
				
				
				
			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…
	
		Reference in New Issue