@parcel/utils 2.0.0-canary.1772 → 2.0.0-canary.1776
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 +22 -0
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
- package/src/import-map.js +47 -0
- package/src/index.js +1 -0
package/lib/index.js
CHANGED
|
@@ -3483,6 +3483,7 @@ $parcel$export(module.exports, "loadSourceMap", () => $3d4b4a41954c6194$export$c
|
|
|
3483
3483
|
$parcel$export(module.exports, "remapSourceLocation", () => $3d4b4a41954c6194$export$2fed780245c466c1);
|
|
3484
3484
|
$parcel$export(module.exports, "stripAnsi", () => (/*@__PURE__*/$parcel$interopDefault($c6e7686f671d96bd$exports)));
|
|
3485
3485
|
$parcel$export(module.exports, "detectSVGOVersion", () => $898ec9690c913f83$export$d9e46360b4510851);
|
|
3486
|
+
$parcel$export(module.exports, "getImportMap", () => $26334e67aed21124$export$3e5fb54e0985f82a);
|
|
3486
3487
|
function $2dffa662028edb3d$export$2e2bcd8739ae039(string, startIndex = 0) {
|
|
3487
3488
|
let lines = 1;
|
|
3488
3489
|
for(let i = startIndex; i < string.length; i++)if (string.charAt(i) === '\n') lines++;
|
|
@@ -38251,5 +38252,26 @@ function $898ec9690c913f83$export$d9e46360b4510851(config) {
|
|
|
38251
38252
|
|
|
38252
38253
|
|
|
38253
38254
|
|
|
38255
|
+
function $26334e67aed21124$export$3e5fb54e0985f82a(bundleGraph, entryBundle) {
|
|
38256
|
+
let mappings = {};
|
|
38257
|
+
for (let childBundle of bundleGraph.getChildBundles(entryBundle))bundleGraph.traverseBundles((bundle, _, actions)=>{
|
|
38258
|
+
if (bundle.bundleBehavior === 'inline') return;
|
|
38259
|
+
mappings[bundle.publicId] = (0, $2cfc43e5a1610e21$export$16778b798ae8e49d)(bundle.name);
|
|
38260
|
+
if (bundle !== entryBundle && $26334e67aed21124$var$isNewContext(bundle, bundleGraph)) {
|
|
38261
|
+
for (let referenced of bundleGraph.getReferencedBundles(bundle))mappings[referenced.publicId] = (0, $2cfc43e5a1610e21$export$16778b798ae8e49d)(referenced.name);
|
|
38262
|
+
// New contexts have their own manifests, so there's no need to continue.
|
|
38263
|
+
actions.skipChildren();
|
|
38264
|
+
}
|
|
38265
|
+
}, childBundle);
|
|
38266
|
+
return mappings;
|
|
38267
|
+
}
|
|
38268
|
+
function $26334e67aed21124$var$isNewContext(bundle, bundleGraph) {
|
|
38269
|
+
let parents = bundleGraph.getParentBundles(bundle);
|
|
38270
|
+
let isInEntryBundleGroup = bundleGraph.getBundleGroupsContainingBundle(bundle).some((g)=>bundleGraph.isEntryBundleGroup(g));
|
|
38271
|
+
return isInEntryBundleGroup || parents.length === 0 || parents.some((parent)=>parent.env.context !== bundle.env.context || parent.type !== 'js');
|
|
38272
|
+
}
|
|
38273
|
+
|
|
38274
|
+
|
|
38275
|
+
|
|
38254
38276
|
|
|
38255
38277
|
//# sourceMappingURL=index.js.map
|