Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function resolveFile(currFile, targetFile) {
try {
isProcessing = true;
let dep = new Dependency({
moduleSpecifier: targetFile,
sourcePath: currFile,
env: environment
});
targetFile = syncPromise(parcel.resolverRunner.resolve(dep));
let targetFileExtension = path.extname(targetFile);
if (!hooks[targetFileExtension]) {
hooks[targetFileExtension] = addHook(hookFunction, {
exts: [targetFileExtension],
ignoreNodeModules: false
});
}
return targetFile;