@zohodesk/client_build_tool 0.0.16-exp.5 → 0.0.16-exp.6

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/README.md CHANGED
@@ -463,175 +463,6 @@ For example
463
463
  - `customAttributes` support for add attributes to html, link , script tag in the output build.
464
464
 
465
465
 
466
- ## v0.0.1 (18-04-2023)
467
-
468
- First Release
469
- **Features:-**
470
-
471
- - 'start' command to run react app
472
- - 'build' command to create build for react app
473
- - 'build:lib' command to create lib for react library
474
- - 'build:es' command to create es for react library
475
- - 'templates' command to create es for react library
476
- # Changelog and Release Notes
477
-
478
- # v0.0.16 (05-11-2025)
479
-
480
- **Adjustments:-**
481
- - ChunkHierarchyPlugin.js – Added support for ConcatenatedModule modules.
482
- - InjectChunkGraphPlugin.js – Changed the template name from {{--preload-chunk-graph-object}} to __PRELOAD_CHUNK_GRAPH__ to resolve minification issues.
483
- - Disabled CSS source map generation – CSS source maps were being created when RTL split was disabled and sourceMap was enabled, causing issues. Hence, CSS source map creation has been disabled
484
- - Source map path correction – The resolving paths in source map files appeared as zohodesk-react/./src, which was incompatible with the Murphy tool. Updated it to zohodesk-react/src by adding a function to devtoolModuleFilenameTemplate in the output configuration.
485
- - ChunkHierarchyPlugin – Made it active in development mode as well by removing the “run only in production” condition.
486
-
487
- # v0.0.15 (11-10-2025)
488
-
489
- **Feature:-**
490
- - Chunk Dependency Mapping: Added a new feature that generates a JSON file listing all chunk dependencies in the Webpack build
491
- For example, if main.js is a chunk, the generated JSON will include all of its direct imports (dependencies).
492
- - Purpose:
493
- To provide clear visibility into chunk relationships and dependencies for debugging, optimization, and performance analysis.
494
-
495
- ```
496
- chunkGraph:{
497
- enable: { value: true },
498
- fileName: ''
499
- }
500
- ```
501
-
502
- - Preload Chunk Split Visualization
503
- Enhanced the Preload Chunk (PLC) mechanism to identify and list the sub-chunks generated from a preloaded parent chunk.
504
- When a chunk is configured for preloading (e.g., ticket.js), the system now traces and records all the split chunks associated with it — for example
505
-
506
- if resourceHints not enabled plc , pfc and custom function related to this are not created
507
-
508
- ```
509
- resourceHints: {
510
- enable: true,
511
- PreloadChunkNames: [//name of chunks to be preload//]
512
- },
513
- ```
514
-
515
-
516
- # v0.0.14 (06-10-2025)
517
-
518
- **Feature:-**
519
- - Added integrity and crossorigin attributes for all the js and css files in index.html
520
-
521
- ```enableSubResourceIntegrity: true
522
- ```
523
- **Adjustments:-**
524
- - add ts-loader to parse tsx and ts files
525
-
526
- # v0.0.13 (02-09-2025)
527
-
528
- **Adjustments:-**
529
- - Source map files are created in the smap/ folder by default. However, they are also being created in the js/ folder to resolve the issue where Murphy was unable to locate them.
530
-
531
- **Feature:-**
532
- - Added support for Murphy to be built as a separate chunk and injected as the top script in the initial HTML.
533
- - To enable this support , add this in your configuration
534
-
535
- ```murphyBootstrapHtml{
536
- enable: true,
537
- chunkName: '',
538
- filePath: ''
539
- }```
540
-
541
-
542
-
543
- # v0.0.12 (14-08-2025)
544
-
545
- - Fixed the initial i18n loading issue caused by using the same function in both the i18nRuntimeDealer plugin and decidePublicPath
546
-
547
- # v0.0.11 (07-08-2025) (had an issue while enable i18n chunk split plugin)
548
- - remove babel-plugin-module-resolver dependencies
549
-
550
- **Adjustments:-**
551
- - Public Folder configuration is separated for development and production
552
-
553
- **Bug Fix:-**
554
- - Fixed the issue where the build log was not visible when `stats (bundle integrity)` was enabled. The problem was resolved by adding an error check in the `bundleIntegrity plugin`.
555
- - Removed the babel-plugin-module-resolver dependency to resolve the alias resolution issue in the application.
556
- - Fixed the issue where a space in the variable name causes it to return an undefined value.
557
- - Fixed the URL path generation issue that occurred while using context in the development setup.
558
-
559
-
560
- # v0.0.10 (12-05-2025)
561
- **Feature:-**
562
- - `alias` support for `build:es` and `build:lib`
563
- - Add babel-plugin-module-resolver dependencies
564
- - Modify getBabelPlugin to include module resolver with aliases
565
-
566
- **Bug Fix:-**
567
- - Enhance runBabelForTSFile to handle both .tsx and .ts file extensions
568
- - Update mockApiHandler to ensure mock function is called correctly
569
-
570
- **Change:-**
571
- - Refactor defaultConfigValues.js to include cli options for enableRTLSplit
572
-
573
- ## v0.0.9
574
-
575
- **Feature:-**
576
- - externals was added to Prevent bundling of certain imported packages and retrieve these external dependencies at runtime.
577
- - to use externals, we use the following pattern in `app > externals` :
578
-
579
- For example
580
- ```
581
- externals: {
582
- <key> : <value>
583
- }
584
- ```
585
-
586
- ## v0.0.6 (4-09-2023)
587
-
588
- **Feature:-**
589
- - Generating bundle integrity report json file for the build assets only in production mode. To use this feature we need to add `stats > enable` or cli flags `enable_stats`.
590
- - Added Resource Cleanup plugin to cleanup resource retained by build tool. this plugin is controlled by efc flag resourcecleanup flag.
591
- - added support for using regex expression to get group of chunks chunkId via Resource Hint plugin prefetch/preload hook.
592
- only will be activate when `resourceHints` => `allowPrefetchingMultipleChunks` as `true`
593
- - added support for glob pattern for custom chunks split logic.
594
- - added options to split chunks base config in the key `app` => `customChunksBaseConfig` as object
595
-
596
- **Change:-**
597
- - i18n name not generated issue fix.
598
- - public path not correctly set issue fix.
599
- - changing plugin hook stages in i18nRuntimePlugin and sourceMapPlugin
600
- ## v0.0.5 (6-08-2023)
601
-
602
- **Changes:--**
603
- - Typo fix in i18nRuntimeDealerPlugin.js
604
- - fixing some bugs in resolvers.js file
605
-
606
- ## v0.0.3 (1-08-2023)
607
-
608
- **Changes:--**
609
- - `devtool` default value changed from `hidden-cheap-source-map` to `source-map`
610
- - unwanted files deleted from build
611
-
612
- **Issue Fix:--**
613
- - The issue with the source map not being created in the build has been fixed."
614
-
615
-
616
- ## v0.0.2 (28-04-2023)
617
-
618
- **Features:-**
619
-
620
- - `devModeContentHashAllowedTypes` support added for some project there will be a need for hash even though they run dev mode. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#devModeContentHashAllowedTypes)
621
- - `devLikeHash` support for disable content hash for file names in production mode. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#devLikeHash)
622
- - `disableReactDevWarning` disable react dev warning such as prop-type warnings will be removed in dev mode build or server. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#disableReactDevWarning) can be enabled via `--disable_react_dev_warning` too.
623
- - `statsLogConfig` support to customize default webpack log after build finished. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#statsLogConfig) can be enabled via `--disable_react_dev_warning` too.
624
- - `enableChunkHash` renamed as `enableFileNameHashing`
625
-
626
- - `pre_processor` command to run the preprocessor.js file.preProcessor runs in build, start, buildEs, buildLib commands bu default. and we have watch mode support as well with the option (`-w`)
627
- - `createSeparateSmap` flag `source_map_enable` renamed as `enable_smap`
628
- - `removeAttribute` option changes as `babelCustomizations.removeAttribute`
629
- - `removePropTypes` support for remove the prop types package in the output build.
630
- - `devConsoleExclude` support for remove the _console statements_ such as _console.log_, _console.warn_ in the output build.
631
- - `manifestJson` default value set as false.
632
- - `customAttributes` support for add attributes to html, link , script tag in the output build.
633
-
634
-
635
466
  ## v0.0.1 (18-04-2023)
636
467
 
637
468
  First Release
package/README_backup.md CHANGED
@@ -294,175 +294,6 @@ For example
294
294
  - `customAttributes` support for add attributes to html, link , script tag in the output build.
295
295
 
296
296
 
297
- ## v0.0.1 (18-04-2023)
298
-
299
- First Release
300
- **Features:-**
301
-
302
- - 'start' command to run react app
303
- - 'build' command to create build for react app
304
- - 'build:lib' command to create lib for react library
305
- - 'build:es' command to create es for react library
306
- - 'templates' command to create es for react library
307
- # Changelog and Release Notes
308
-
309
- # v0.0.16 (05-11-2025)
310
-
311
- **Adjustments:-**
312
- - ChunkHierarchyPlugin.js – Added support for ConcatenatedModule modules.
313
- - InjectChunkGraphPlugin.js – Changed the template name from {{--preload-chunk-graph-object}} to __PRELOAD_CHUNK_GRAPH__ to resolve minification issues.
314
- - Disabled CSS source map generation – CSS source maps were being created when RTL split was disabled and sourceMap was enabled, causing issues. Hence, CSS source map creation has been disabled
315
- - Source map path correction – The resolving paths in source map files appeared as zohodesk-react/./src, which was incompatible with the Murphy tool. Updated it to zohodesk-react/src by adding a function to devtoolModuleFilenameTemplate in the output configuration.
316
- - ChunkHierarchyPlugin – Made it active in development mode as well by removing the “run only in production” condition.
317
-
318
- # v0.0.15 (11-10-2025)
319
-
320
- **Feature:-**
321
- - Chunk Dependency Mapping: Added a new feature that generates a JSON file listing all chunk dependencies in the Webpack build
322
- For example, if main.js is a chunk, the generated JSON will include all of its direct imports (dependencies).
323
- - Purpose:
324
- To provide clear visibility into chunk relationships and dependencies for debugging, optimization, and performance analysis.
325
-
326
- ```
327
- chunkGraph:{
328
- enable: { value: true },
329
- fileName: ''
330
- }
331
- ```
332
-
333
- - Preload Chunk Split Visualization
334
- Enhanced the Preload Chunk (PLC) mechanism to identify and list the sub-chunks generated from a preloaded parent chunk.
335
- When a chunk is configured for preloading (e.g., ticket.js), the system now traces and records all the split chunks associated with it — for example
336
-
337
- if resourceHints not enabled plc , pfc and custom function related to this are not created
338
-
339
- ```
340
- resourceHints: {
341
- enable: true,
342
- PreloadChunkNames: [//name of chunks to be preload//]
343
- },
344
- ```
345
-
346
-
347
- # v0.0.14 (06-10-2025)
348
-
349
- **Feature:-**
350
- - Added integrity and crossorigin attributes for all the js and css files in index.html
351
-
352
- ```enableSubResourceIntegrity: true
353
- ```
354
- **Adjustments:-**
355
- - add ts-loader to parse tsx and ts files
356
-
357
- # v0.0.13 (02-09-2025)
358
-
359
- **Adjustments:-**
360
- - Source map files are created in the smap/ folder by default. However, they are also being created in the js/ folder to resolve the issue where Murphy was unable to locate them.
361
-
362
- **Feature:-**
363
- - Added support for Murphy to be built as a separate chunk and injected as the top script in the initial HTML.
364
- - To enable this support , add this in your configuration
365
-
366
- ```murphyBootstrapHtml{
367
- enable: true,
368
- chunkName: '',
369
- filePath: ''
370
- }```
371
-
372
-
373
-
374
- # v0.0.12 (14-08-2025)
375
-
376
- - Fixed the initial i18n loading issue caused by using the same function in both the i18nRuntimeDealer plugin and decidePublicPath
377
-
378
- # v0.0.11 (07-08-2025) (had an issue while enable i18n chunk split plugin)
379
- - remove babel-plugin-module-resolver dependencies
380
-
381
- **Adjustments:-**
382
- - Public Folder configuration is separated for development and production
383
-
384
- **Bug Fix:-**
385
- - Fixed the issue where the build log was not visible when `stats (bundle integrity)` was enabled. The problem was resolved by adding an error check in the `bundleIntegrity plugin`.
386
- - Removed the babel-plugin-module-resolver dependency to resolve the alias resolution issue in the application.
387
- - Fixed the issue where a space in the variable name causes it to return an undefined value.
388
- - Fixed the URL path generation issue that occurred while using context in the development setup.
389
-
390
-
391
- # v0.0.10 (12-05-2025)
392
- **Feature:-**
393
- - `alias` support for `build:es` and `build:lib`
394
- - Add babel-plugin-module-resolver dependencies
395
- - Modify getBabelPlugin to include module resolver with aliases
396
-
397
- **Bug Fix:-**
398
- - Enhance runBabelForTSFile to handle both .tsx and .ts file extensions
399
- - Update mockApiHandler to ensure mock function is called correctly
400
-
401
- **Change:-**
402
- - Refactor defaultConfigValues.js to include cli options for enableRTLSplit
403
-
404
- ## v0.0.9
405
-
406
- **Feature:-**
407
- - externals was added to Prevent bundling of certain imported packages and retrieve these external dependencies at runtime.
408
- - to use externals, we use the following pattern in `app > externals` :
409
-
410
- For example
411
- ```
412
- externals: {
413
- <key> : <value>
414
- }
415
- ```
416
-
417
- ## v0.0.6 (4-09-2023)
418
-
419
- **Feature:-**
420
- - Generating bundle integrity report json file for the build assets only in production mode. To use this feature we need to add `stats > enable` or cli flags `enable_stats`.
421
- - Added Resource Cleanup plugin to cleanup resource retained by build tool. this plugin is controlled by efc flag resourcecleanup flag.
422
- - added support for using regex expression to get group of chunks chunkId via Resource Hint plugin prefetch/preload hook.
423
- only will be activate when `resourceHints` => `allowPrefetchingMultipleChunks` as `true`
424
- - added support for glob pattern for custom chunks split logic.
425
- - added options to split chunks base config in the key `app` => `customChunksBaseConfig` as object
426
-
427
- **Change:-**
428
- - i18n name not generated issue fix.
429
- - public path not correctly set issue fix.
430
- - changing plugin hook stages in i18nRuntimePlugin and sourceMapPlugin
431
- ## v0.0.5 (6-08-2023)
432
-
433
- **Changes:--**
434
- - Typo fix in i18nRuntimeDealerPlugin.js
435
- - fixing some bugs in resolvers.js file
436
-
437
- ## v0.0.3 (1-08-2023)
438
-
439
- **Changes:--**
440
- - `devtool` default value changed from `hidden-cheap-source-map` to `source-map`
441
- - unwanted files deleted from build
442
-
443
- **Issue Fix:--**
444
- - The issue with the source map not being created in the build has been fixed."
445
-
446
-
447
- ## v0.0.2 (28-04-2023)
448
-
449
- **Features:-**
450
-
451
- - `devModeContentHashAllowedTypes` support added for some project there will be a need for hash even though they run dev mode. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#devModeContentHashAllowedTypes)
452
- - `devLikeHash` support for disable content hash for file names in production mode. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#devLikeHash)
453
- - `disableReactDevWarning` disable react dev warning such as prop-type warnings will be removed in dev mode build or server. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#disableReactDevWarning) can be enabled via `--disable_react_dev_warning` too.
454
- - `statsLogConfig` support to customize default webpack log after build finished. for details [details](https://zgit.csez.zohocorpin.com/zohodesk/react-cli/-/blob/3.0.0/packages/client_build_tool/ConfigurationDocumentation.md#statsLogConfig) can be enabled via `--disable_react_dev_warning` too.
455
- - `enableChunkHash` renamed as `enableFileNameHashing`
456
-
457
- - `pre_processor` command to run the preprocessor.js file.preProcessor runs in build, start, buildEs, buildLib commands bu default. and we have watch mode support as well with the option (`-w`)
458
- - `createSeparateSmap` flag `source_map_enable` renamed as `enable_smap`
459
- - `removeAttribute` option changes as `babelCustomizations.removeAttribute`
460
- - `removePropTypes` support for remove the prop types package in the output build.
461
- - `devConsoleExclude` support for remove the _console statements_ such as _console.log_, _console.warn_ in the output build.
462
- - `manifestJson` default value set as false.
463
- - `customAttributes` support for add attributes to html, link , script tag in the output build.
464
-
465
-
466
297
  ## v0.0.1 (18-04-2023)
467
298
 
468
299
  First Release
@@ -15,9 +15,6 @@ var _default = {
15
15
  value: 'app',
16
16
  cli: 'context'
17
17
  },
18
- library: {
19
- ignorePatterns: []
20
- },
21
18
  devtool: 'source-map',
22
19
  statsLogConfig: null,
23
20
  stats: {
@@ -30,7 +30,7 @@ function babelWebConfig(options, mode) {
30
30
  } = options.typeScript;
31
31
  return {
32
32
  presets: typeScriptEnable ? [getBabelPresetEnvConfig(browserList, mode), require.resolve('@babel/preset-react'), require.resolve('@babel/preset-typescript')] : [getBabelPresetEnvConfig(browserList, mode), require.resolve('@babel/preset-react')],
33
- plugins: customBabelPlugins(babelPlugins).concat((0, _getBabelPlugin.getBabelPlugin)(options, mode)).filter(Boolean)
33
+ plugins: customBabelPlugins(babelPlugins).concat((0, _getBabelPlugin.getBabelPlugin)(options)).filter(Boolean)
34
34
  };
35
35
  }
36
36
 
@@ -16,22 +16,12 @@ const babelPluginMapping = {
16
16
  };
17
17
  const babelPluginOrder = ['removeAttribute', 'removePropTypes', 'devConsoleExclude'];
18
18
 
19
- function getBabelPlugin(options, command) {
19
+ function getBabelPlugin(options) {
20
20
  const {
21
21
  mode
22
- } = options;
23
- const {
24
- alias
25
- } = options.resolve;
26
- let customPlugins = [];
27
-
28
- if (command == 'es' || command == 'lib') {
29
- customPlugins = [[require.resolve('babel-plugin-module-resolver'), {
30
- root: ['./'],
31
- alias
32
- }]];
33
- }
22
+ } = options; // let customPlugins = [];
34
23
 
24
+ let customPlugins = [];
35
25
  const {
36
26
  babelCustomizations
37
27
  } = options;
@@ -11,32 +11,18 @@ var _babelWebConfig = require("./babelWebConfig");
11
11
 
12
12
  var _copyFile = require("../fileUtils/copyFile");
13
13
 
14
- var _fs = require("fs");
15
-
16
14
  function runBabelForTSFile({
17
15
  filename,
18
16
  outputFile,
19
17
  options,
20
18
  mode = 'es'
21
19
  }) {
22
- const {
23
- ignorePatterns
24
- } = options.library;
25
20
  const {
26
21
  enable
27
22
  } = options.typeScript;
28
23
 
29
24
  if (enable) {
30
- function shouldIgnore(filename) {
31
- return ignorePatterns.some(pattern => pattern.test(filename));
32
- }
33
-
34
- if (shouldIgnore(filename)) {
35
- const jsSourceCode = (0, _fs.readFileSync)(filename).toString();
36
- (0, _copyFile.writeFile)(outputFile, jsSourceCode);
37
- return;
38
- }
39
-
25
+ // const jsSourceCode = readFileSync(filename).toString();
40
26
  const babelConfig = (0, _babelWebConfig.babelWebConfig)(options, mode);
41
27
  const result = (0, _core.transformFileSync)(filename, babelConfig);
42
28
  (0, _copyFile.writeFile)(outputFile.replace('.tsx', '.js').replace('.ts', '.js'), result.code);
@@ -1,78 +1,68 @@
1
1
  "use strict";
2
2
 
3
3
  // plugins/ChunkHierarchyPlugin.js
4
- const fs = require("fs");
4
+ const fs = require('fs');
5
5
 
6
- const path = require("path");
6
+ const path = require('path');
7
7
 
8
8
  class ChunkHierarchyPlugin {
9
- constructor(outputFileName) {
10
- this.outputFileName = outputFileName || "chunk-hierarchy-report.json";
9
+ constructor(outputFile) {
10
+ this.outputFile = outputFile || 'chunk-hierarchy-report.json';
11
11
  }
12
12
 
13
13
  apply(compiler) {
14
- compiler.hooks.afterEmit.tap("ChunkHierarchyPlugin", compilation => {
15
- try {
16
- const {
17
- chunkGraph,
18
- moduleGraph
19
- } = compilation;
20
- const hierarchy = {};
14
+ compiler.hooks.emit.tapAsync('ChunkHierarchyPlugin', (compilation, callback) => {
15
+ const result = {};
16
+ const rootContext = path.resolve(compiler.context, '..', '..');
21
17
 
22
- for (const chunk of compilation.chunks) {
23
- // skip unnamed or runtime chunks
24
- if (chunk.name && chunk.name.includes("runtime")) {
25
- continue;
26
- }
18
+ for (const chunk of compilation.chunks) {
19
+ const chunkName = chunk.name || chunk.id;
20
+ const modules = [];
27
21
 
28
- ;
29
- const modules = chunkGraph.getChunkModulesIterable(chunk);
30
- const deps = new Set();
22
+ for (const module of compilation.chunkGraph.getChunkModulesIterable(chunk)) {
23
+ // Recursively extract real modules (handle ConcatenatedModules)
24
+ collectModules(module, modules, rootContext);
25
+ }
31
26
 
32
- for (const module of modules) {
33
- for (const conn of moduleGraph.getOutgoingConnections(module)) {
34
- if (!conn.module) continue;
35
- const mod = conn.module;
27
+ result[chunkName] = modules;
28
+ }
36
29
 
37
- const ConcatenatedModule = require("webpack/lib/optimize/ConcatenatedModule");
30
+ const json = JSON.stringify(result, null, 2);
31
+ const outputPath = compiler.outputPath;
32
+ const outputFile = path.join(outputPath, this.outputFile);
33
+ fs.mkdirSync(outputPath, {
34
+ recursive: true
35
+ });
36
+ fs.writeFileSync(outputFile, json, 'utf-8');
37
+ callback();
38
+ });
39
+ }
38
40
 
39
- if (mod instanceof ConcatenatedModule) {
40
- for (const inner of mod.modules) {
41
- if (inner.resource) {
42
- const match = inner.resource.match(/(?<!node_modules\/)jsapps\/.*/);
41
+ }
43
42
 
44
- if (match && /^(?!.*node_modules).*$/.test(match)) {
45
- deps.add(match[0]);
46
- }
47
- }
48
- }
49
- } else {
50
- const identifier = mod.resource || mod.identifier();
51
- const match = identifier && identifier.match(/(?<!node_modules\/)jsapps\/.*/);
43
+ function collectModules(module, modules, context) {
44
+ // Handle normal modules
45
+ if (module.resource) {
46
+ console.log(module.resource);
47
+ modules.push(path.relative(context, module.resource));
48
+ return;
49
+ } // Handle ConcatenatedModule (webpack internal)
52
50
 
53
- if (match && /^(?!.*node_modules).*$/.test(match)) {
54
- deps.add(match[0]);
55
- }
56
- }
57
- }
58
- }
59
51
 
60
- hierarchy[chunk.name || chunk.id] = Array.from(deps);
61
- }
52
+ if (module.modules) {
53
+ for (const innerModule of module.modules) {
54
+ collectModules(innerModule, modules, context);
55
+ }
56
+ } // Handle Webpack 5 internal API (ConcatenatedModule inside _orderedConcatenationList)
62
57
 
63
- const outputPath = compiler.options.output.path;
64
- const outputFile = path.join(outputPath, this.outputFileName); // Ensure folder exists before writing
65
58
 
66
- fs.mkdirSync(outputPath, {
67
- recursive: true
68
- });
69
- fs.writeFileSync(outputFile, JSON.stringify(hierarchy, null, 2), "utf-8");
70
- } catch (err) {
71
- console.error("❌ ChunkHierarchyPlugin failed:", err);
59
+ if (module._orderedConcatenationList) {
60
+ for (const item of module._orderedConcatenationList) {
61
+ if (item.module) {
62
+ collectModules(item.module, modules, context);
72
63
  }
73
- });
64
+ }
74
65
  }
75
-
76
66
  }
77
67
 
78
68
  module.exports = ChunkHierarchyPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.16-exp.5",
3
+ "version": "0.0.16-exp.6",
4
4
  "description": "A CLI tool to build web applications and client libraries",
5
5
  "main": "lib/index.js",
6
6
  "bin": {