@atlaspack/transformer-js 3.3.11-typescript-bc4459c37.0 → 3.4.1-typescript-5ad950d33.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.
@@ -382,7 +382,9 @@ var _default = exports.default = new (_plugin().Transformer)({
382
382
  // @ts-expect-error TS2339
383
383
  is_constant_module,
384
384
  // @ts-expect-error TS2339
385
- conditions
385
+ conditions,
386
+ // @ts-expect-error TS2339
387
+ magic_comments
386
388
  } = await (_rust().transformAsync || _rust().transform)({
387
389
  filename: asset.filePath,
388
390
  code,
@@ -419,7 +421,7 @@ var _default = exports.default = new (_plugin().Transformer)({
419
421
  conditional_bundling: options.featureFlags.conditionalBundlingApi,
420
422
  hmr_improvements: options.featureFlags.hmrImprovements,
421
423
  computed_properties_fix: options.featureFlags.unusedComputedPropertyFix,
422
- magic_comments: Boolean(config === null || config === void 0 ? void 0 : config.magicComments),
424
+ magic_comments: Boolean(config === null || config === void 0 ? void 0 : config.magicComments) || (0, _featureFlags().getFeatureFlag)('supportWebpackChunkName'),
423
425
  callMacro: asset.isSource ? async (err, src, exportName, args, loc) => {
424
426
  let mod;
425
427
  try {
@@ -740,6 +742,12 @@ var _default = exports.default = new (_plugin().Transformer)({
740
742
  outputFormat,
741
743
  loc: convertLoc(dep.loc)
742
744
  };
745
+ if ((0, _featureFlags().getFeatureFlag)('supportWebpackChunkName')) {
746
+ let chunkName = magic_comments[dep.specifier];
747
+ if (chunkName) {
748
+ meta.chunkName = chunkName;
749
+ }
750
+ }
743
751
  }
744
752
 
745
753
  // 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.3.11-typescript-bc4459c37.0",
3
+ "version": "3.4.1-typescript-5ad950d33.0",
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.2-typescript-bc4459c37.0",
28
- "@atlaspack/feature-flags": "2.19.3-typescript-bc4459c37.0",
29
- "@atlaspack/plugin": "2.14.21-typescript-bc4459c37.0",
30
- "@atlaspack/rust": "3.4.2-typescript-bc4459c37.0",
31
- "@atlaspack/utils": "2.17.3-typescript-bc4459c37.0",
32
- "@atlaspack/workers": "2.14.21-typescript-bc4459c37.0",
27
+ "@atlaspack/diagnostic": "2.14.2-typescript-5ad950d33.0",
28
+ "@atlaspack/feature-flags": "2.20.1-typescript-5ad950d33.0",
29
+ "@atlaspack/plugin": "2.14.22-typescript-5ad950d33.0",
30
+ "@atlaspack/rust": "3.4.2-typescript-5ad950d33.0",
31
+ "@atlaspack/utils": "2.17.4-typescript-5ad950d33.0",
32
+ "@atlaspack/workers": "2.14.22-typescript-5ad950d33.0",
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.13.1"
42
42
  },
43
43
  "type": "commonjs",
44
- "gitHead": "bc4459c37a38ef1f74772126637e1d8841d1fcb0"
44
+ "gitHead": "5ad950d33a5f2255ebeb10c04a2e84c346e2de85"
45
45
  }
@@ -465,6 +465,8 @@ export default new Transformer({
465
465
  is_constant_module,
466
466
  // @ts-expect-error TS2339
467
467
  conditions,
468
+ // @ts-expect-error TS2339
469
+ magic_comments,
468
470
  } = await (transformAsync || transform)({
469
471
  filename: asset.filePath,
470
472
  code,
@@ -508,7 +510,9 @@ export default new Transformer({
508
510
  conditional_bundling: options.featureFlags.conditionalBundlingApi,
509
511
  hmr_improvements: options.featureFlags.hmrImprovements,
510
512
  computed_properties_fix: options.featureFlags.unusedComputedPropertyFix,
511
- magic_comments: Boolean(config?.magicComments),
513
+ magic_comments:
514
+ Boolean(config?.magicComments) ||
515
+ getFeatureFlag('supportWebpackChunkName'),
512
516
  callMacro: asset.isSource
513
517
  ? async (err: any, src: any, exportName: any, args: any, loc: any) => {
514
518
  let mod;
@@ -894,6 +898,13 @@ export default new Transformer({
894
898
  outputFormat,
895
899
  loc: convertLoc(dep.loc),
896
900
  };
901
+
902
+ if (getFeatureFlag('supportWebpackChunkName')) {
903
+ let chunkName = magic_comments[dep.specifier];
904
+ if (chunkName) {
905
+ meta.chunkName = chunkName;
906
+ }
907
+ }
897
908
  }
898
909
 
899
910
  // Always bundle helpers, even with includeNodeModules: false, except if this is a library.