@atlaspack/transformer-js 3.2.3-canary.136 → 3.2.3-canary.137
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 +10 -2
- package/package.json +8 -8
- package/src/JSTransformer.js +12 -2
package/lib/JSTransformer.js
CHANGED
|
@@ -355,7 +355,8 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
355
355
|
used_env,
|
|
356
356
|
has_node_replacements,
|
|
357
357
|
is_constant_module,
|
|
358
|
-
conditions
|
|
358
|
+
conditions,
|
|
359
|
+
magic_comments
|
|
359
360
|
} = await (_rust().transformAsync || _rust().transform)({
|
|
360
361
|
filename: asset.filePath,
|
|
361
362
|
code,
|
|
@@ -402,8 +403,9 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
402
403
|
conditional_bundling: options.featureFlags.conditionalBundlingApi,
|
|
403
404
|
hmr_improvements: options.featureFlags.hmrImprovements,
|
|
404
405
|
computed_properties_fix: options.featureFlags.unusedComputedPropertyFix,
|
|
406
|
+
magic_comments:
|
|
405
407
|
// $FlowFixMe
|
|
406
|
-
|
|
408
|
+
Boolean(config === null || config === void 0 ? void 0 : config.magicComments) || (0, _featureFlags().getFeatureFlag)('supportWebpackChunkName'),
|
|
407
409
|
callMacro: asset.isSource ? async (err, src, exportName, args, loc) => {
|
|
408
410
|
let mod;
|
|
409
411
|
try {
|
|
@@ -714,6 +716,12 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
714
716
|
outputFormat,
|
|
715
717
|
loc: convertLoc(dep.loc)
|
|
716
718
|
};
|
|
719
|
+
if ((0, _featureFlags().getFeatureFlag)('supportWebpackChunkName')) {
|
|
720
|
+
let chunkName = magic_comments[dep.specifier];
|
|
721
|
+
if (chunkName) {
|
|
722
|
+
meta.chunkName = chunkName;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
717
725
|
}
|
|
718
726
|
|
|
719
727
|
// Always bundle helpers, even with includeNodeModules: false, except if this is a library.
|
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.137+069de478e",
|
|
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.1-canary.
|
|
26
|
-
"@atlaspack/feature-flags": "2.14.1-canary.
|
|
27
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
28
|
-
"@atlaspack/rust": "3.2.1-canary.
|
|
29
|
-
"@atlaspack/utils": "2.14.5-canary.
|
|
30
|
-
"@atlaspack/workers": "2.14.5-canary.
|
|
25
|
+
"@atlaspack/diagnostic": "2.14.1-canary.205+069de478e",
|
|
26
|
+
"@atlaspack/feature-flags": "2.14.1-canary.205+069de478e",
|
|
27
|
+
"@atlaspack/plugin": "2.14.5-canary.137+069de478e",
|
|
28
|
+
"@atlaspack/rust": "3.2.1-canary.137+069de478e",
|
|
29
|
+
"@atlaspack/utils": "2.14.5-canary.137+069de478e",
|
|
30
|
+
"@atlaspack/workers": "2.14.5-canary.137+069de478e",
|
|
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": "069de478e64fb5889f6f2ce023eb510782767fbd"
|
|
43
43
|
}
|
package/src/JSTransformer.js
CHANGED
|
@@ -438,6 +438,7 @@ export default (new Transformer({
|
|
|
438
438
|
has_node_replacements,
|
|
439
439
|
is_constant_module,
|
|
440
440
|
conditions,
|
|
441
|
+
magic_comments,
|
|
441
442
|
} = await (transformAsync || transform)({
|
|
442
443
|
filename: asset.filePath,
|
|
443
444
|
code,
|
|
@@ -490,8 +491,10 @@ export default (new Transformer({
|
|
|
490
491
|
conditional_bundling: options.featureFlags.conditionalBundlingApi,
|
|
491
492
|
hmr_improvements: options.featureFlags.hmrImprovements,
|
|
492
493
|
computed_properties_fix: options.featureFlags.unusedComputedPropertyFix,
|
|
493
|
-
|
|
494
|
-
|
|
494
|
+
magic_comments:
|
|
495
|
+
// $FlowFixMe
|
|
496
|
+
Boolean(config?.magicComments) ||
|
|
497
|
+
getFeatureFlag('supportWebpackChunkName'),
|
|
495
498
|
callMacro: asset.isSource
|
|
496
499
|
? async (err, src, exportName, args, loc) => {
|
|
497
500
|
let mod;
|
|
@@ -867,6 +870,13 @@ export default (new Transformer({
|
|
|
867
870
|
outputFormat,
|
|
868
871
|
loc: convertLoc(dep.loc),
|
|
869
872
|
};
|
|
873
|
+
|
|
874
|
+
if (getFeatureFlag('supportWebpackChunkName')) {
|
|
875
|
+
let chunkName = magic_comments[dep.specifier];
|
|
876
|
+
if (chunkName) {
|
|
877
|
+
meta.chunkName = chunkName;
|
|
878
|
+
}
|
|
879
|
+
}
|
|
870
880
|
}
|
|
871
881
|
|
|
872
882
|
// Always bundle helpers, even with includeNodeModules: false, except if this is a library.
|