MCPcopy
hub / github.com/webpack/webpack / defaultResolve

Method defaultResolve

lib/NormalModuleFactory.js:904–950  ·  view source on GitHub ↗
(context)

Source from the content-addressed store, hash-verified

902 * @param {string} context context
903 */
904 const defaultResolve = (context) => {
905 if (/^(?:$|\?)/.test(unresolvedResource)) {
906 resourceData = {
907 ...cacheParseResource(unresolvedResource),
908 resource: unresolvedResource,
909 data: {}
910 };
911 continueCallback();
912 }
913
914 // resource without scheme and with path
915 else {
916 const normalResolver = this.getResolver(
917 "normal",
918 dependencyType
919 ? cachedSetProperty(
920 resolveOptions || EMPTY_RESOLVE_OPTIONS,
921 "dependencyType",
922 dependencyType
923 )
924 : resolveOptions
925 );
926 this.resolveResource(
927 contextInfo,
928 context,
929 escapeHashInPathRequest(unresolvedResource),
930 normalResolver,
931 resolveContext,
932 (err, _resolvedResource, resolvedResourceResolveData) => {
933 if (err) return continueCallback(err);
934 if (_resolvedResource !== false) {
935 const resolvedResource =
936 /** @type {string} */
937 (_resolvedResource);
938 resourceData = {
939 ...cacheParseResource(resolvedResource),
940 resource: resolvedResource,
941 data:
942 /** @type {ResolveRequest} */
943 (resolvedResourceResolveData)
944 };
945 }
946 continueCallback();
947 }
948 );
949 }
950 };
951
952 // resource with scheme
953 if (scheme) {

Callers

nothing calls this directly

Calls 5

getResolverMethod · 0.95
resolveResourceMethod · 0.95
cachedSetPropertyFunction · 0.85
escapeHashInPathRequestFunction · 0.85
testMethod · 0.45

Tested by

no test coverage detected