@gjsify/rolldown-plugin-pnp 0.4.28 → 0.4.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +5 -7
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -90,9 +90,7 @@ export async function pnpPlugin(opts = {}) {
|
|
|
90
90
|
if (!importer)
|
|
91
91
|
return null;
|
|
92
92
|
// Importer may be a file URL string or an absolute path.
|
|
93
|
-
const importerPath = importer.startsWith('file://')
|
|
94
|
-
? fileURLToPath(importer)
|
|
95
|
-
: importer;
|
|
93
|
+
const importerPath = importer.startsWith('file://') ? fileURLToPath(importer) : importer;
|
|
96
94
|
// Fast path: resolve from the importer's own context.
|
|
97
95
|
try {
|
|
98
96
|
const resolved = pnpApi.resolveRequest(source, importerPath);
|
|
@@ -158,8 +156,8 @@ export async function pnpPlugin(opts = {}) {
|
|
|
158
156
|
};
|
|
159
157
|
}
|
|
160
158
|
function isUndeclaredDependency(err) {
|
|
161
|
-
return typeof err === 'object'
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
159
|
+
return (typeof err === 'object' &&
|
|
160
|
+
err !== null &&
|
|
161
|
+
'pnpCode' in err &&
|
|
162
|
+
err.pnpCode === 'UNDECLARED_DEPENDENCY');
|
|
165
163
|
}
|