@parcel/packager-js 2.0.0-nightly.1367 → 2.0.0-nightly.1369
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.
|
@@ -257,8 +257,10 @@ class ScopeHoistingPackager {
|
|
|
257
257
|
}];
|
|
258
258
|
});
|
|
259
259
|
if (asset.meta.shouldWrap || this.isAsyncBundle || this.bundle.env.sourceType === 'script' || this.bundleGraph.isAssetReferenced(this.bundle, asset) || this.bundleGraph.getIncomingDependencies(asset).some(dep => dep.meta.shouldWrap && dep.specifierType !== 'url')) {
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
if (!asset.meta.isConstantModule) {
|
|
261
|
+
this.wrappedAssets.add(asset.id);
|
|
262
|
+
wrapped.push(asset);
|
|
263
|
+
}
|
|
262
264
|
}
|
|
263
265
|
});
|
|
264
266
|
for (let wrappedAssetRoot of [...wrapped]) {
|
|
@@ -270,8 +272,10 @@ class ScopeHoistingPackager {
|
|
|
270
272
|
actions.skipChildren();
|
|
271
273
|
return;
|
|
272
274
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
+
if (!asset.meta.isConstantModule) {
|
|
276
|
+
this.wrappedAssets.add(asset.id);
|
|
277
|
+
wrapped.push(asset);
|
|
278
|
+
}
|
|
275
279
|
}, wrappedAssetRoot);
|
|
276
280
|
}
|
|
277
281
|
this.assetOutputs = new Map(await queue.run());
|
|
@@ -639,6 +643,10 @@ ${code}
|
|
|
639
643
|
}
|
|
640
644
|
}
|
|
641
645
|
isWrapped(resolved, parentAsset) {
|
|
646
|
+
if (resolved.meta.isConstantModule) {
|
|
647
|
+
(0, _assert().default)(this.bundle.hasAsset(resolved), 'Constant module not found in bundle');
|
|
648
|
+
return false;
|
|
649
|
+
}
|
|
642
650
|
return !this.bundle.hasAsset(resolved) && !this.externalAssets.has(resolved) || this.wrappedAssets.has(resolved.id) && resolved !== parentAsset;
|
|
643
651
|
}
|
|
644
652
|
getSymbolResolution(parentAsset, resolved, imported, dep) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@parcel/packager-js",
|
|
3
|
-
"version": "2.0.0-nightly.
|
|
3
|
+
"version": "2.0.0-nightly.1369+52254bbb4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -17,17 +17,17 @@
|
|
|
17
17
|
"source": "src/index.js",
|
|
18
18
|
"engines": {
|
|
19
19
|
"node": ">= 12.0.0",
|
|
20
|
-
"parcel": "2.0.0-nightly.
|
|
20
|
+
"parcel": "2.0.0-nightly.1367+52254bbb4"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@parcel/diagnostic": "2.0.0-nightly.
|
|
24
|
-
"@parcel/plugin": "2.0.0-nightly.
|
|
25
|
-
"@parcel/rust": "2.9.4-nightly.
|
|
23
|
+
"@parcel/diagnostic": "2.0.0-nightly.1369+52254bbb4",
|
|
24
|
+
"@parcel/plugin": "2.0.0-nightly.1369+52254bbb4",
|
|
25
|
+
"@parcel/rust": "2.9.4-nightly.2992+52254bbb4",
|
|
26
26
|
"@parcel/source-map": "^2.1.1",
|
|
27
|
-
"@parcel/types": "2.0.0-nightly.
|
|
28
|
-
"@parcel/utils": "2.0.0-nightly.
|
|
27
|
+
"@parcel/types": "2.0.0-nightly.1369+52254bbb4",
|
|
28
|
+
"@parcel/utils": "2.0.0-nightly.1369+52254bbb4",
|
|
29
29
|
"globals": "^13.2.0",
|
|
30
30
|
"nullthrows": "^1.1.1"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "52254bbb43388fcaebee2181520b2f77e1034c2f"
|
|
33
33
|
}
|
|
@@ -331,8 +331,10 @@ export class ScopeHoistingPackager {
|
|
|
331
331
|
.getIncomingDependencies(asset)
|
|
332
332
|
.some(dep => dep.meta.shouldWrap && dep.specifierType !== 'url')
|
|
333
333
|
) {
|
|
334
|
-
|
|
335
|
-
|
|
334
|
+
if (!asset.meta.isConstantModule) {
|
|
335
|
+
this.wrappedAssets.add(asset.id);
|
|
336
|
+
wrapped.push(asset);
|
|
337
|
+
}
|
|
336
338
|
}
|
|
337
339
|
});
|
|
338
340
|
|
|
@@ -346,9 +348,10 @@ export class ScopeHoistingPackager {
|
|
|
346
348
|
actions.skipChildren();
|
|
347
349
|
return;
|
|
348
350
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
351
|
+
if (!asset.meta.isConstantModule) {
|
|
352
|
+
this.wrappedAssets.add(asset.id);
|
|
353
|
+
wrapped.push(asset);
|
|
354
|
+
}
|
|
352
355
|
}, wrappedAssetRoot);
|
|
353
356
|
}
|
|
354
357
|
|
|
@@ -828,6 +831,13 @@ ${code}
|
|
|
828
831
|
}
|
|
829
832
|
|
|
830
833
|
isWrapped(resolved: Asset, parentAsset: Asset): boolean {
|
|
834
|
+
if (resolved.meta.isConstantModule) {
|
|
835
|
+
invariant(
|
|
836
|
+
this.bundle.hasAsset(resolved),
|
|
837
|
+
'Constant module not found in bundle',
|
|
838
|
+
);
|
|
839
|
+
return false;
|
|
840
|
+
}
|
|
831
841
|
return (
|
|
832
842
|
(!this.bundle.hasAsset(resolved) && !this.externalAssets.has(resolved)) ||
|
|
833
843
|
(this.wrappedAssets.has(resolved.id) && resolved !== parentAsset)
|