enhanced-resolve
Advanced tools
Comparing version 5.4.0 to 5.4.1
@@ -8,2 +8,4 @@ /* | ||
const nextTick = require("process").nextTick; | ||
/** @typedef {import("./Resolver").FileSystem} FileSystem */ | ||
@@ -179,4 +181,4 @@ /** @typedef {import("./Resolver").SyncFileSystem} SyncFileSystem */ | ||
if (cacheEntry !== undefined) { | ||
if (cacheEntry.err) return process.nextTick(callback, cacheEntry.err); | ||
return process.nextTick(callback, null, cacheEntry.result); | ||
if (cacheEntry.err) return nextTick(callback, cacheEntry.err); | ||
return nextTick(callback, null, cacheEntry.result); | ||
} | ||
@@ -183,0 +185,0 @@ |
@@ -42,6 +42,12 @@ /* | ||
const packageMatch = /^(@[^/]+\/)?[^/]+/.exec(req); | ||
if (!packageMatch) return callback(); | ||
const packageName = packageMatch[0]; | ||
const innerRequest = `.${req.slice(packageName.length)}`; | ||
let resolution; | ||
let apiResolution; | ||
try { | ||
resolution = this.pnpApi.resolveToUnqualified(req, issuer, { | ||
resolution = this.pnpApi.resolveToUnqualified(packageName, issuer, { | ||
considerBuiltins: false | ||
@@ -71,3 +77,3 @@ }); | ||
if (resolution === req) return callback(); | ||
if (resolution === packageName) return callback(); | ||
@@ -81,6 +87,5 @@ if (apiResolution && resolveContext.fileDependencies) { | ||
path: resolution, | ||
request: undefined, | ||
request: innerRequest, | ||
ignoreSymlinks: true, | ||
fullySpecified: | ||
request.fullySpecified && !/^(@[^/]+\/)?[^/]+$/.test(req) | ||
fullySpecified: request.fullySpecified && innerRequest !== "." | ||
}; | ||
@@ -87,0 +92,0 @@ resolver.doResolve( |
@@ -156,3 +156,3 @@ /* | ||
), | ||
/** @type {AsyncSeriesHook<[ResolveRequest, ResolveContext], void>} */ | ||
/** @type {AsyncSeriesHook<[ResolveRequest, ResolveContext]>} */ | ||
result: new AsyncSeriesHook(["result", "resolveContext"], "result") | ||
@@ -159,0 +159,0 @@ }; |
@@ -8,2 +8,3 @@ /* | ||
const versions = require("process").versions; | ||
const Resolver = require("./Resolver"); | ||
@@ -116,3 +117,3 @@ const { getType, PathType } = require("./util/path"); | ||
option === undefined && | ||
/** @type {NodeJS.ProcessVersions & {pnp: string}} */ (process.versions).pnp | ||
/** @type {NodeJS.ProcessVersions & {pnp: string}} */ (versions).pnp | ||
) { | ||
@@ -400,3 +401,5 @@ // @ts-ignore | ||
if (item.includes("node_modules") && pnpApi) { | ||
plugins.push(new PnpPlugin("raw-module", pnpApi, "relative")); | ||
plugins.push( | ||
new PnpPlugin("raw-module", pnpApi, "undescribed-resolve-in-package") | ||
); | ||
} | ||
@@ -403,0 +406,0 @@ } else { |
{ | ||
"name": "enhanced-resolve", | ||
"version": "5.4.0", | ||
"version": "5.4.1", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -11,5 +11,9 @@ "description": "Offers a async require.resolve function. It's highly configurable.", | ||
], | ||
"browser": { | ||
"pnpapi": false, | ||
"process": "./lib/util/process-browser.js" | ||
}, | ||
"dependencies": { | ||
"graceful-fs": "^4.2.4", | ||
"tapable": "^2.0.0" | ||
"tapable": "^2.2.0" | ||
}, | ||
@@ -32,3 +36,3 @@ "license": "MIT", | ||
"should": "^13.2.3", | ||
"tooling": "webpack/tooling#v1.8.0", | ||
"tooling": "webpack/tooling#v1.11.0", | ||
"typescript": "^4.0.2" | ||
@@ -35,0 +39,0 @@ }, |
@@ -219,8 +219,6 @@ /* | ||
BaseResolveRequest & Partial<ParsedIdentifier> | ||
], | ||
void | ||
] | ||
>; | ||
noResolve: SyncHook< | ||
[BaseResolveRequest & Partial<ParsedIdentifier>, Error], | ||
void | ||
[BaseResolveRequest & Partial<ParsedIdentifier>, Error] | ||
>; | ||
@@ -227,0 +225,0 @@ resolve: AsyncSeriesBailHook< |
155261
45
4889
Updatedtapable@^2.2.0