Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
}
// only use the node resolver if the importRequest is a path, or is
// a module request but not one that's probably a webpackShim. This
// prevents false positives as webpackShims are likely to be resolved
// to the node_modules directory by the node resolver, but we want
// them to resolve to the actual shim
if (isPathRequest || !isProbablyWebpackShim(importRequest, file)) {
const nodeResult = tryNodeResolver(importRequest, file, config);
if (nodeResult && nodeResult.found) {
return nodeResult;
}
}
return webpackResolver.resolve(importRequest, file, {
config: webpackConfig,
});
};
resolveFile(importPath, source) {
const cacheKey = importPath + source;
const cachedResult = this.cache[cacheKey];
if (cachedResult !== undefined) {
return cachedResult;
}
const result = resolver.resolve(importPath, source, {
config: this.webpackConfig,
'config-index': this.webpackConfigIndex,
});
const resolvedPath = result.found ? result.path : null;
this.cache[cacheKey] = resolvedPath;
return resolvedPath;
}
}