@atlaspack/transformer-js 3.3.8-noselfbuild-3f2849b52.0 → 3.3.8-noselfbuild-342bd6c75.0
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/JSTransformer.js +4 -0
- package/package.json +8 -8
- package/src/JSTransformer.js +4 -0
package/lib/JSTransformer.js
CHANGED
|
@@ -344,6 +344,7 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
344
344
|
shebang,
|
|
345
345
|
hoist_result,
|
|
346
346
|
symbol_result,
|
|
347
|
+
is_empty_or_empty_export,
|
|
347
348
|
needs_esm_helpers,
|
|
348
349
|
diagnostics,
|
|
349
350
|
used_env,
|
|
@@ -822,6 +823,9 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
822
823
|
// (and the asset has side effects), or the asset is wrapped.
|
|
823
824
|
// This allows accessing symbols that don't exist without errors in symbol propagation.
|
|
824
825
|
if (hoist_result.has_cjs_exports || !hoist_result.is_esm && asset.sideEffects && deps.size === 0 && Object.keys(hoist_result.exported_symbols).length === 0 || hoist_result.should_wrap && !asset.symbols.hasExportSymbol('*')) {
|
|
826
|
+
if (is_empty_or_empty_export) {
|
|
827
|
+
asset.meta.emptyFileStarReexport = true;
|
|
828
|
+
}
|
|
825
829
|
asset.symbols.set('*', `$${asset.id}$exports`);
|
|
826
830
|
}
|
|
827
831
|
asset.meta.hasCJSExports = hoist_result.has_cjs_exports;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/transformer-js",
|
|
3
|
-
"version": "3.3.8-noselfbuild-
|
|
3
|
+
"version": "3.3.8-noselfbuild-342bd6c75.0",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"src"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@atlaspack/diagnostic": "2.14.2-noselfbuild-
|
|
26
|
-
"@atlaspack/feature-flags": "2.18.5-noselfbuild-
|
|
27
|
-
"@atlaspack/plugin": "2.14.18-noselfbuild-
|
|
28
|
-
"@atlaspack/rust": "3.4.1-noselfbuild-
|
|
29
|
-
"@atlaspack/utils": "2.16.2-noselfbuild-
|
|
30
|
-
"@atlaspack/workers": "2.14.18-noselfbuild-
|
|
25
|
+
"@atlaspack/diagnostic": "2.14.2-noselfbuild-342bd6c75.0",
|
|
26
|
+
"@atlaspack/feature-flags": "2.18.5-noselfbuild-342bd6c75.0",
|
|
27
|
+
"@atlaspack/plugin": "2.14.18-noselfbuild-342bd6c75.0",
|
|
28
|
+
"@atlaspack/rust": "3.4.1-noselfbuild-342bd6c75.0",
|
|
29
|
+
"@atlaspack/utils": "2.16.2-noselfbuild-342bd6c75.0",
|
|
30
|
+
"@atlaspack/workers": "2.14.18-noselfbuild-342bd6c75.0",
|
|
31
31
|
"@parcel/source-map": "^2.1.1",
|
|
32
32
|
"@swc/helpers": "^0.5.15",
|
|
33
33
|
"browserslist": "^4.6.6",
|
|
@@ -39,5 +39,5 @@
|
|
|
39
39
|
"@atlaspack/core": "^2.13.1"
|
|
40
40
|
},
|
|
41
41
|
"type": "commonjs",
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "342bd6c75293750e0f0a7636ddc8dfe30707efb6"
|
|
43
43
|
}
|
package/src/JSTransformer.js
CHANGED
|
@@ -428,6 +428,7 @@ export default (new Transformer({
|
|
|
428
428
|
shebang,
|
|
429
429
|
hoist_result,
|
|
430
430
|
symbol_result,
|
|
431
|
+
is_empty_or_empty_export,
|
|
431
432
|
needs_esm_helpers,
|
|
432
433
|
diagnostics,
|
|
433
434
|
used_env,
|
|
@@ -1004,6 +1005,9 @@ export default (new Transformer({
|
|
|
1004
1005
|
Object.keys(hoist_result.exported_symbols).length === 0) ||
|
|
1005
1006
|
(hoist_result.should_wrap && !asset.symbols.hasExportSymbol('*'))
|
|
1006
1007
|
) {
|
|
1008
|
+
if (is_empty_or_empty_export) {
|
|
1009
|
+
asset.meta.emptyFileStarReexport = true;
|
|
1010
|
+
}
|
|
1007
1011
|
asset.symbols.set('*', `$${asset.id}$exports`);
|
|
1008
1012
|
}
|
|
1009
1013
|
|