bare-module-traverse 2.5.0 → 2.5.1
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/index.js +9 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -504,9 +504,13 @@ function* resolveImport(entry, specifier, condition, parentURL, imports, artifac
|
|
|
504
504
|
} else if (condition === 'asset') {
|
|
505
505
|
const prefix = url
|
|
506
506
|
|
|
507
|
+
let prefixResolution = null
|
|
508
|
+
|
|
507
509
|
for (const url of yield { prefix }) {
|
|
508
510
|
const resolution = yield* postresolve(url)
|
|
509
511
|
|
|
512
|
+
if (url.href === prefix.href) prefixResolution = resolution
|
|
513
|
+
|
|
510
514
|
yield {
|
|
511
515
|
children: exports.module(resolution, null, {}, artifacts, visited, {
|
|
512
516
|
...opts,
|
|
@@ -520,7 +524,11 @@ function* resolveImport(entry, specifier, condition, parentURL, imports, artifac
|
|
|
520
524
|
resolved = true
|
|
521
525
|
}
|
|
522
526
|
|
|
523
|
-
if (resolved)
|
|
527
|
+
if (resolved) {
|
|
528
|
+
resolution = prefixResolution || (yield* postresolve(prefix))
|
|
529
|
+
|
|
530
|
+
addResolution(imports, specifier, matchedConditions, resolution)
|
|
531
|
+
}
|
|
524
532
|
} else if (
|
|
525
533
|
condition === 'addon' ||
|
|
526
534
|
moduleType(url, entry.attributes, null, opts) === constants.ADDON
|