@atlaspack/transformer-js 3.2.3-canary.246 → 3.2.3-canary.248
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 +7 -1
- package/package.json +8 -8
- package/src/JSTransformer.ts +13 -0
package/lib/JSTransformer.js
CHANGED
|
@@ -242,6 +242,8 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
242
242
|
let inlineConstants = false;
|
|
243
243
|
let magicComments = false;
|
|
244
244
|
let addReactDisplayName = false;
|
|
245
|
+
let enableGlobalThisAliaser = Boolean(options.env.NATIVE_GLOBAL_THIS_ALIASER);
|
|
246
|
+
let enableLazyLoadingTransformer = Boolean(options.env.NATIVE_LAZY_LOADING_TRANSFORMER);
|
|
245
247
|
if (conf && conf.contents) {
|
|
246
248
|
var _conf$contents, _conf$contents2, _conf$contents3, _conf$contents4, _conf$contents5;
|
|
247
249
|
_utils().validateSchema.diagnostic(CONFIG_SCHEMA, {
|
|
@@ -279,7 +281,9 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
279
281
|
reactRefresh,
|
|
280
282
|
decorators,
|
|
281
283
|
useDefineForClassFields,
|
|
282
|
-
magicComments
|
|
284
|
+
magicComments,
|
|
285
|
+
enableGlobalThisAliaser,
|
|
286
|
+
enableLazyLoadingTransformer
|
|
283
287
|
};
|
|
284
288
|
},
|
|
285
289
|
async transform({
|
|
@@ -430,6 +434,8 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
430
434
|
add_display_name: Boolean(config.addReactDisplayName),
|
|
431
435
|
exports_rebinding_optimisation: options.featureFlags.exportsRebindingOptimisation,
|
|
432
436
|
magic_comments: Boolean(config === null || config === void 0 ? void 0 : config.magicComments) || (0, _featureFlags().getFeatureFlag)('supportWebpackChunkName'),
|
|
437
|
+
enable_global_this_aliaser: Boolean(config.enableGlobalThisAliaser),
|
|
438
|
+
enable_lazy_loading_transformer: Boolean(config.enableLazyLoadingTransformer),
|
|
433
439
|
callMacro: asset.isSource ? async (err, src, exportName, args, loc) => {
|
|
434
440
|
let mod;
|
|
435
441
|
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.248+525898e33",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -24,12 +24,12 @@
|
|
|
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/utils": "2.14.5-canary.
|
|
32
|
-
"@atlaspack/workers": "2.14.5-canary.
|
|
27
|
+
"@atlaspack/diagnostic": "2.14.1-canary.316+525898e33",
|
|
28
|
+
"@atlaspack/feature-flags": "2.14.1-canary.316+525898e33",
|
|
29
|
+
"@atlaspack/plugin": "2.14.5-canary.248+525898e33",
|
|
30
|
+
"@atlaspack/rust": "3.2.1-canary.248+525898e33",
|
|
31
|
+
"@atlaspack/utils": "2.14.5-canary.248+525898e33",
|
|
32
|
+
"@atlaspack/workers": "2.14.5-canary.248+525898e33",
|
|
33
33
|
"@parcel/source-map": "^2.1.1",
|
|
34
34
|
"@swc/helpers": "^0.5.15",
|
|
35
35
|
"browserslist": "^4.6.6",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"@atlaspack/core": "2.26.0"
|
|
42
42
|
},
|
|
43
43
|
"type": "commonjs",
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "525898e33cc229a4bc938ae853732be36d20c01a"
|
|
45
45
|
}
|
package/src/JSTransformer.ts
CHANGED
|
@@ -303,6 +303,13 @@ export default new Transformer({
|
|
|
303
303
|
let magicComments = false;
|
|
304
304
|
let addReactDisplayName = false;
|
|
305
305
|
|
|
306
|
+
let enableGlobalThisAliaser = Boolean(
|
|
307
|
+
options.env.NATIVE_GLOBAL_THIS_ALIASER,
|
|
308
|
+
);
|
|
309
|
+
let enableLazyLoadingTransformer = Boolean(
|
|
310
|
+
options.env.NATIVE_LAZY_LOADING_TRANSFORMER,
|
|
311
|
+
);
|
|
312
|
+
|
|
306
313
|
if (conf && conf.contents) {
|
|
307
314
|
validateSchema.diagnostic(
|
|
308
315
|
CONFIG_SCHEMA,
|
|
@@ -346,6 +353,8 @@ export default new Transformer({
|
|
|
346
353
|
decorators,
|
|
347
354
|
useDefineForClassFields,
|
|
348
355
|
magicComments,
|
|
356
|
+
enableGlobalThisAliaser,
|
|
357
|
+
enableLazyLoadingTransformer,
|
|
349
358
|
};
|
|
350
359
|
},
|
|
351
360
|
async transform({asset, config, options, logger}) {
|
|
@@ -524,6 +533,10 @@ export default new Transformer({
|
|
|
524
533
|
magic_comments:
|
|
525
534
|
Boolean(config?.magicComments) ||
|
|
526
535
|
getFeatureFlag('supportWebpackChunkName'),
|
|
536
|
+
enable_global_this_aliaser: Boolean(config.enableGlobalThisAliaser),
|
|
537
|
+
enable_lazy_loading_transformer: Boolean(
|
|
538
|
+
config.enableLazyLoadingTransformer,
|
|
539
|
+
),
|
|
527
540
|
callMacro: asset.isSource
|
|
528
541
|
? async (err: any, src: any, exportName: any, args: any, loc: any) => {
|
|
529
542
|
let mod;
|