@atlaspack/transformer-js 3.2.3-canary.300 → 3.2.3-canary.301
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 +9 -3
- package/package.json +9 -9
- package/src/JSTransformer.ts +14 -6
package/lib/JSTransformer.js
CHANGED
|
@@ -243,8 +243,10 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
243
243
|
let inlineConstants = false;
|
|
244
244
|
let magicComments = false;
|
|
245
245
|
let addReactDisplayName = false;
|
|
246
|
-
let enableGlobalThisAliaser =
|
|
247
|
-
let enableLazyLoadingTransformer =
|
|
246
|
+
let enableGlobalThisAliaser = options.env.NATIVE_GLOBAL_THIS_ALIASER === 'true';
|
|
247
|
+
let enableLazyLoadingTransformer = options.env.NATIVE_LAZY_LOADING_TRANSFORMER === 'true';
|
|
248
|
+
let enableDeadReturnsRemover = options.env.NATIVE_DEAD_RETURNS_REMOVER === 'true';
|
|
249
|
+
let enableUnusedBindingsRemover = options.env.NATIVE_UNUSED_BINDINGS_REMOVER === 'true';
|
|
248
250
|
if (conf && conf.contents) {
|
|
249
251
|
var _conf$contents, _conf$contents2, _conf$contents3, _conf$contents4, _conf$contents5;
|
|
250
252
|
_utils().validateSchema.diagnostic(CONFIG_SCHEMA, {
|
|
@@ -283,7 +285,9 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
283
285
|
useDefineForClassFields,
|
|
284
286
|
magicComments,
|
|
285
287
|
enableGlobalThisAliaser,
|
|
286
|
-
enableLazyLoadingTransformer
|
|
288
|
+
enableLazyLoadingTransformer,
|
|
289
|
+
enableDeadReturnsRemover,
|
|
290
|
+
enableUnusedBindingsRemover
|
|
287
291
|
};
|
|
288
292
|
},
|
|
289
293
|
async transform({
|
|
@@ -438,6 +442,8 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
438
442
|
enable_global_this_aliaser: Boolean(config.enableGlobalThisAliaser),
|
|
439
443
|
enable_lazy_loading_transformer: Boolean(config.enableLazyLoadingTransformer),
|
|
440
444
|
nested_promise_import_fix: options.featureFlags.nestedPromiseImportFix,
|
|
445
|
+
enable_dead_returns_remover: Boolean(config.enableDeadReturnsRemover),
|
|
446
|
+
enable_unused_bindings_remover: Boolean(config.enableUnusedBindingsRemover),
|
|
441
447
|
callMacro: asset.isSource ? async (err, src, exportName, args, loc) => {
|
|
442
448
|
let mod;
|
|
443
449
|
try {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/transformer-js",
|
|
3
|
-
"version": "3.2.3-canary.
|
|
3
|
+
"version": "3.2.3-canary.301+25fee723d",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"src"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@atlaspack/diagnostic": "2.14.1-canary.
|
|
28
|
-
"@atlaspack/feature-flags": "2.14.1-canary.
|
|
29
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
30
|
-
"@atlaspack/rust": "3.2.1-canary.
|
|
31
|
-
"@atlaspack/source-map": "3.1.1-canary.
|
|
32
|
-
"@atlaspack/utils": "2.14.5-canary.
|
|
33
|
-
"@atlaspack/workers": "2.14.5-canary.
|
|
27
|
+
"@atlaspack/diagnostic": "2.14.1-canary.369+25fee723d",
|
|
28
|
+
"@atlaspack/feature-flags": "2.14.1-canary.369+25fee723d",
|
|
29
|
+
"@atlaspack/plugin": "2.14.5-canary.301+25fee723d",
|
|
30
|
+
"@atlaspack/rust": "3.2.1-canary.301+25fee723d",
|
|
31
|
+
"@atlaspack/source-map": "3.1.1-canary.4080+25fee723d",
|
|
32
|
+
"@atlaspack/utils": "2.14.5-canary.301+25fee723d",
|
|
33
|
+
"@atlaspack/workers": "2.14.5-canary.301+25fee723d",
|
|
34
34
|
"@swc/helpers": "^0.5.15",
|
|
35
35
|
"browserslist": "^4.6.6",
|
|
36
36
|
"nullthrows": "^1.1.1",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"@atlaspack/core": "2.28.0"
|
|
42
42
|
},
|
|
43
43
|
"type": "commonjs",
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "25fee723d2228d0482ec8a8f1b8379ccd2977ce7"
|
|
45
45
|
}
|
package/src/JSTransformer.ts
CHANGED
|
@@ -302,12 +302,14 @@ export default new Transformer({
|
|
|
302
302
|
let magicComments = false;
|
|
303
303
|
let addReactDisplayName = false;
|
|
304
304
|
|
|
305
|
-
let enableGlobalThisAliaser =
|
|
306
|
-
options.env.NATIVE_GLOBAL_THIS_ALIASER
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
305
|
+
let enableGlobalThisAliaser =
|
|
306
|
+
options.env.NATIVE_GLOBAL_THIS_ALIASER === 'true';
|
|
307
|
+
let enableLazyLoadingTransformer =
|
|
308
|
+
options.env.NATIVE_LAZY_LOADING_TRANSFORMER === 'true';
|
|
309
|
+
let enableDeadReturnsRemover =
|
|
310
|
+
options.env.NATIVE_DEAD_RETURNS_REMOVER === 'true';
|
|
311
|
+
let enableUnusedBindingsRemover =
|
|
312
|
+
options.env.NATIVE_UNUSED_BINDINGS_REMOVER === 'true';
|
|
311
313
|
|
|
312
314
|
if (conf && conf.contents) {
|
|
313
315
|
validateSchema.diagnostic(
|
|
@@ -353,6 +355,8 @@ export default new Transformer({
|
|
|
353
355
|
magicComments,
|
|
354
356
|
enableGlobalThisAliaser,
|
|
355
357
|
enableLazyLoadingTransformer,
|
|
358
|
+
enableDeadReturnsRemover,
|
|
359
|
+
enableUnusedBindingsRemover,
|
|
356
360
|
};
|
|
357
361
|
},
|
|
358
362
|
async transform({asset, config, options, logger}) {
|
|
@@ -537,6 +541,10 @@ export default new Transformer({
|
|
|
537
541
|
config.enableLazyLoadingTransformer,
|
|
538
542
|
),
|
|
539
543
|
nested_promise_import_fix: options.featureFlags.nestedPromiseImportFix,
|
|
544
|
+
enable_dead_returns_remover: Boolean(config.enableDeadReturnsRemover),
|
|
545
|
+
enable_unused_bindings_remover: Boolean(
|
|
546
|
+
config.enableUnusedBindingsRemover,
|
|
547
|
+
),
|
|
540
548
|
callMacro: asset.isSource
|
|
541
549
|
? async (err: any, src: any, exportName: any, args: any, loc: any) => {
|
|
542
550
|
let mod;
|