@parcel/packager-js 2.0.0-nightly.854 → 2.0.0-nightly.857
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.
|
@@ -686,7 +686,7 @@ ${code}
|
|
|
686
686
|
// and no __esModule flag, we need to resolve to the namespace instead.
|
|
687
687
|
|
|
688
688
|
|
|
689
|
-
let isDefaultInterop = exportSymbol === 'default' && staticExports && !isWrapped && (dep === null || dep === void 0 ? void 0 : dep.meta.kind) === 'Import' && resolvedAsset.symbols.hasExportSymbol('*') && resolvedAsset.symbols.hasExportSymbol('default') && !resolvedAsset.symbols.hasExportSymbol('__esModule'); // Find the namespace object for the resolved module. If wrapped and this
|
|
689
|
+
let isDefaultInterop = exportSymbol === 'default' && staticExports && !isWrapped && ((dep === null || dep === void 0 ? void 0 : dep.meta.kind) === 'Import' || (dep === null || dep === void 0 ? void 0 : dep.meta.kind) === 'Export') && resolvedAsset.symbols.hasExportSymbol('*') && resolvedAsset.symbols.hasExportSymbol('default') && !resolvedAsset.symbols.hasExportSymbol('__esModule'); // Find the namespace object for the resolved module. If wrapped and this
|
|
690
690
|
// is an inline require (not top-level), use a parcelRequire call, otherwise
|
|
691
691
|
// the hoisted variable declared above. Otherwise, if not wrapped, use the
|
|
692
692
|
// namespace export symbol.
|
|
@@ -704,7 +704,9 @@ ${code}
|
|
|
704
704
|
// we need to use a member access off the namespace object rather
|
|
705
705
|
// than a direct reference. If importing default from a CJS module,
|
|
706
706
|
// use a helper to check the __esModule flag at runtime.
|
|
707
|
-
|
|
707
|
+
let kind = dep === null || dep === void 0 ? void 0 : dep.meta.kind;
|
|
708
|
+
|
|
709
|
+
if ((!dep || kind === 'Import' || kind === 'Export') && exportSymbol === 'default' && resolvedAsset.symbols.hasExportSymbol('*') && this.needsDefaultInterop(resolvedAsset)) {
|
|
708
710
|
this.usedHelpers.add('$parcel$interopDefault');
|
|
709
711
|
return `(/*@__PURE__*/$parcel$interopDefault(${obj}))`;
|
|
710
712
|
} else {
|
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.857+76205cb0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"parcel": "^2.0.0-beta.1"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@parcel/diagnostic": "2.0.0-nightly.
|
|
24
|
-
"@parcel/hash": "2.0.0-nightly.
|
|
25
|
-
"@parcel/plugin": "2.0.0-nightly.
|
|
23
|
+
"@parcel/diagnostic": "2.0.0-nightly.857+76205cb0",
|
|
24
|
+
"@parcel/hash": "2.0.0-nightly.2479+76205cb0",
|
|
25
|
+
"@parcel/plugin": "2.0.0-nightly.857+76205cb0",
|
|
26
26
|
"@parcel/source-map": "2.0.0-rc.7",
|
|
27
|
-
"@parcel/utils": "2.0.0-nightly.
|
|
27
|
+
"@parcel/utils": "2.0.0-nightly.857+76205cb0",
|
|
28
28
|
"globals": "^13.2.0",
|
|
29
29
|
"nullthrows": "^1.1.1"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "76205cb0f7c6cd15bd0869f9486c042f7e78cc63"
|
|
32
32
|
}
|
|
@@ -741,7 +741,7 @@ ${code}
|
|
|
741
741
|
exportSymbol === 'default' &&
|
|
742
742
|
staticExports &&
|
|
743
743
|
!isWrapped &&
|
|
744
|
-
dep?.meta.kind === 'Import' &&
|
|
744
|
+
(dep?.meta.kind === 'Import' || dep?.meta.kind === 'Export') &&
|
|
745
745
|
resolvedAsset.symbols.hasExportSymbol('*') &&
|
|
746
746
|
resolvedAsset.symbols.hasExportSymbol('default') &&
|
|
747
747
|
!resolvedAsset.symbols.hasExportSymbol('__esModule');
|
|
@@ -771,8 +771,9 @@ ${code}
|
|
|
771
771
|
// we need to use a member access off the namespace object rather
|
|
772
772
|
// than a direct reference. If importing default from a CJS module,
|
|
773
773
|
// use a helper to check the __esModule flag at runtime.
|
|
774
|
+
let kind = dep?.meta.kind;
|
|
774
775
|
if (
|
|
775
|
-
dep
|
|
776
|
+
(!dep || kind === 'Import' || kind === 'Export') &&
|
|
776
777
|
exportSymbol === 'default' &&
|
|
777
778
|
resolvedAsset.symbols.hasExportSymbol('*') &&
|
|
778
779
|
this.needsDefaultInterop(resolvedAsset)
|