@parcel/utils 2.16.0 → 2.16.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/lib/index.js +10 -2
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
- package/src/import-map.js +14 -4
package/lib/index.js
CHANGED
|
@@ -38338,7 +38338,15 @@ async function $898ec9690c913f83$var$throwDiagnostic(message, filePath, jsonPath
|
|
|
38338
38338
|
|
|
38339
38339
|
|
|
38340
38340
|
|
|
38341
|
+
let $26334e67aed21124$var$importMapCache = new WeakMap();
|
|
38341
38342
|
function $26334e67aed21124$export$3e5fb54e0985f82a(bundleGraph, entryBundle) {
|
|
38343
|
+
let cache = $26334e67aed21124$var$importMapCache.get(bundleGraph);
|
|
38344
|
+
if (!cache) {
|
|
38345
|
+
cache = new WeakMap();
|
|
38346
|
+
$26334e67aed21124$var$importMapCache.set(bundleGraph, cache);
|
|
38347
|
+
}
|
|
38348
|
+
let cached = cache.get(entryBundle);
|
|
38349
|
+
if (cached) return cached;
|
|
38342
38350
|
let mappings = {};
|
|
38343
38351
|
for (let childBundle of bundleGraph.getChildBundles(entryBundle))bundleGraph.traverseBundles((bundle, _, actions)=>{
|
|
38344
38352
|
if (bundle.bundleBehavior === 'inline') return;
|
|
@@ -38349,12 +38357,12 @@ function $26334e67aed21124$export$3e5fb54e0985f82a(bundleGraph, entryBundle) {
|
|
|
38349
38357
|
actions.skipChildren();
|
|
38350
38358
|
}
|
|
38351
38359
|
}, childBundle);
|
|
38360
|
+
cache.set(entryBundle, mappings);
|
|
38352
38361
|
return mappings;
|
|
38353
38362
|
}
|
|
38354
38363
|
function $26334e67aed21124$var$isNewContext(bundle, bundleGraph) {
|
|
38355
38364
|
let parents = bundleGraph.getParentBundles(bundle);
|
|
38356
|
-
|
|
38357
|
-
return isInEntryBundleGroup || parents.length === 0 || parents.some((parent)=>parent.env.context !== bundle.env.context || parent.type !== 'js');
|
|
38365
|
+
return parents.length === 0 || parents.some((parent)=>parent.env.context !== bundle.env.context || parent.type !== 'js');
|
|
38358
38366
|
}
|
|
38359
38367
|
|
|
38360
38368
|
|