@parcel/utils 2.13.3 → 2.14.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 +28 -4
- 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/src/urlJoin.js +15 -2
package/lib/index.js
CHANGED
|
@@ -34,7 +34,7 @@ function $parcel$interopDefault(a) {
|
|
|
34
34
|
var $parcel$modules = {};
|
|
35
35
|
var $parcel$inits = {};
|
|
36
36
|
|
|
37
|
-
var parcelRequire = $parcel$global["
|
|
37
|
+
var parcelRequire = $parcel$global["parcelRequire0b48"];
|
|
38
38
|
|
|
39
39
|
if (parcelRequire == null) {
|
|
40
40
|
parcelRequire = function(id) {
|
|
@@ -58,7 +58,7 @@ if (parcelRequire == null) {
|
|
|
58
58
|
$parcel$inits[id] = init;
|
|
59
59
|
};
|
|
60
60
|
|
|
61
|
-
$parcel$global["
|
|
61
|
+
$parcel$global["parcelRequire0b48"] = parcelRequire;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
var parcelRegister = parcelRequire.register;
|
|
@@ -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++;
|
|
@@ -34646,7 +34647,7 @@ class $d0205e6a737975d7$export$2e2bcd8739ae039 extends (0, $houHs$stream.Transfo
|
|
|
34646
34647
|
|
|
34647
34648
|
|
|
34648
34649
|
|
|
34649
|
-
function $13647135c22990e2$export$2e2bcd8739ae039(publicURL, assetPath) {
|
|
34650
|
+
function $13647135c22990e2$export$2e2bcd8739ae039(publicURL, assetPath, leadingDotSlash = false) {
|
|
34650
34651
|
const url = (0, ($parcel$interopDefault($houHs$url))).parse(publicURL, false, true);
|
|
34651
34652
|
// Leading / ensures that paths with colons are not parsed as a protocol.
|
|
34652
34653
|
let p = assetPath.startsWith('/') ? assetPath : '/' + assetPath;
|
|
@@ -34654,7 +34655,9 @@ function $13647135c22990e2$export$2e2bcd8739ae039(publicURL, assetPath) {
|
|
|
34654
34655
|
url.pathname = (0, ($parcel$interopDefault($houHs$path))).posix.join(url.pathname, assetUrl.pathname);
|
|
34655
34656
|
url.search = assetUrl.search;
|
|
34656
34657
|
url.hash = assetUrl.hash;
|
|
34657
|
-
|
|
34658
|
+
let result = (0, ($parcel$interopDefault($houHs$url))).format(url);
|
|
34659
|
+
if (url.host == null && result[0] !== '/' && result[0] !== '.' && leadingDotSlash) result = './' + result;
|
|
34660
|
+
return result;
|
|
34658
34661
|
}
|
|
34659
34662
|
|
|
34660
34663
|
|
|
@@ -38251,5 +38254,26 @@ function $898ec9690c913f83$export$d9e46360b4510851(config) {
|
|
|
38251
38254
|
|
|
38252
38255
|
|
|
38253
38256
|
|
|
38257
|
+
function $26334e67aed21124$export$3e5fb54e0985f82a(bundleGraph, entryBundle) {
|
|
38258
|
+
let mappings = {};
|
|
38259
|
+
for (let childBundle of bundleGraph.getChildBundles(entryBundle))bundleGraph.traverseBundles((bundle, _, actions)=>{
|
|
38260
|
+
if (bundle.bundleBehavior === 'inline') return;
|
|
38261
|
+
mappings[bundle.publicId] = (0, $2cfc43e5a1610e21$export$16778b798ae8e49d)(bundle.name);
|
|
38262
|
+
if (bundle !== entryBundle && $26334e67aed21124$var$isNewContext(bundle, bundleGraph)) {
|
|
38263
|
+
for (let referenced of bundleGraph.getReferencedBundles(bundle))mappings[referenced.publicId] = (0, $2cfc43e5a1610e21$export$16778b798ae8e49d)(referenced.name);
|
|
38264
|
+
// New contexts have their own manifests, so there's no need to continue.
|
|
38265
|
+
actions.skipChildren();
|
|
38266
|
+
}
|
|
38267
|
+
}, childBundle);
|
|
38268
|
+
return mappings;
|
|
38269
|
+
}
|
|
38270
|
+
function $26334e67aed21124$var$isNewContext(bundle, bundleGraph) {
|
|
38271
|
+
let parents = bundleGraph.getParentBundles(bundle);
|
|
38272
|
+
let isInEntryBundleGroup = bundleGraph.getBundleGroupsContainingBundle(bundle).some((g)=>bundleGraph.isEntryBundleGroup(g));
|
|
38273
|
+
return isInEntryBundleGroup || parents.length === 0 || parents.some((parent)=>parent.env.context !== bundle.env.context || parent.type !== 'js');
|
|
38274
|
+
}
|
|
38275
|
+
|
|
38276
|
+
|
|
38277
|
+
|
|
38254
38278
|
|
|
38255
38279
|
//# sourceMappingURL=index.js.map
|