@zohodesk/client_build_tool 0.0.15 → 0.0.16-exp.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog and Release Notes
2
2
 
3
+ # v0.0.16 (05-11-2025)
4
+
5
+ **Adjustments:-**
6
+ - ChunkHierarchyPlugin.js – Added support for ConcatenatedModule modules.
7
+ - InjectChunkGraphPlugin.js – Changed the template name from {{--preload-chunk-graph-object}} to __PRELOAD_CHUNK_GRAPH__ to resolve minification issues.
8
+ - 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
9
+ - 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.
10
+ - ChunkHierarchyPlugin – Made it active in development mode as well by removing the “run only in production” condition.
11
+
3
12
  # v0.0.15 (11-10-2025)
4
13
 
5
14
  **Feature:-**
@@ -19,6 +28,8 @@ To provide clear visibility into chunk relationships and dependencies for debugg
19
28
  Enhanced the Preload Chunk (PLC) mechanism to identify and list the sub-chunks generated from a preloaded parent chunk.
20
29
  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
21
30
 
31
+ if resourceHints not enabled plc , pfc and custom function related to this are not created
32
+
22
33
  ```
23
34
  resourceHints: {
24
35
  enable: true,
package/README.md CHANGED
@@ -306,6 +306,184 @@ First Release
306
306
  - 'templates' command to create es for react library
307
307
  # Changelog and Release Notes
308
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
+ ## 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
+
309
487
  # v0.0.15 (11-10-2025)
310
488
 
311
489
  **Feature:-**
@@ -325,6 +503,8 @@ To provide clear visibility into chunk relationships and dependencies for debugg
325
503
  Enhanced the Preload Chunk (PLC) mechanism to identify and list the sub-chunks generated from a preloaded parent chunk.
326
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
327
505
 
506
+ if resourceHints not enabled plc , pfc and custom function related to this are not created
507
+
328
508
  ```
329
509
  resourceHints: {
330
510
  enable: true,
package/README_backup.md CHANGED
@@ -294,6 +294,175 @@ 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
+
297
466
  ## v0.0.1 (18-04-2023)
298
467
 
299
468
  First Release
@@ -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)).filter(Boolean)
33
+ plugins: customBabelPlugins(babelPlugins).concat((0, _getBabelPlugin.getBabelPlugin)(options, mode)).filter(Boolean)
34
34
  };
35
35
  }
36
36
 
@@ -16,12 +16,22 @@ const babelPluginMapping = {
16
16
  };
17
17
  const babelPluginOrder = ['removeAttribute', 'removePropTypes', 'devConsoleExclude'];
18
18
 
19
- function getBabelPlugin(options) {
19
+ function getBabelPlugin(options, command) {
20
20
  const {
21
21
  mode
22
- } = options; // let customPlugins = [];
23
-
22
+ } = options;
23
+ const {
24
+ alias
25
+ } = options.resolve;
24
26
  let customPlugins = [];
27
+
28
+ if (command == 'es' || command == 'lib') {
29
+ customPlugins = [[require.resolve('babel-plugin-module-resolver'), {
30
+ root: ['./'],
31
+ alias
32
+ }]];
33
+ }
34
+
25
35
  const {
26
36
  babelCustomizations
27
37
  } = options;
@@ -21,13 +21,7 @@ class ChunkHierarchyPlugin {
21
21
 
22
22
  for (const chunk of compilation.chunks) {
23
23
  // skip unnamed or runtime chunks
24
- if (!chunk.name) {
25
- continue;
26
- }
27
-
28
- ;
29
-
30
- if (chunk.name.includes("runtime")) {
24
+ if (chunk.name && chunk.name.includes("runtime")) {
31
25
  continue;
32
26
  }
33
27
 
@@ -37,13 +31,33 @@ class ChunkHierarchyPlugin {
37
31
 
38
32
  for (const module of modules) {
39
33
  for (const conn of moduleGraph.getOutgoingConnections(module)) {
40
- if (conn.module && conn.module.resource) {
41
- deps.add(conn.module.resource.match(/jsapps\/supportapp.*/)?.[0]);
34
+ if (!conn.module) continue;
35
+ const mod = conn.module;
36
+
37
+ const ConcatenatedModule = require("webpack/lib/optimize/ConcatenatedModule");
38
+
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\/.*/);
43
+
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\/.*/);
52
+
53
+ if (match && /^(?!.*node_modules).*$/.test(match)) {
54
+ deps.add(match[0]);
55
+ }
42
56
  }
43
57
  }
44
58
  }
45
59
 
46
- hierarchy[chunk.name] = Array.from(deps);
60
+ hierarchy[chunk.name || chunk.id] = Array.from(deps);
47
61
  }
48
62
 
49
63
  const outputPath = compiler.options.output.path;
@@ -33,9 +33,13 @@ class InjectChunkGraphPlugin {
33
33
  const runtimeChunk = stats.chunks.find(chunk => chunk.names?.some(n => n.includes('runtime~main')));
34
34
  const runtimeChunkName = runtimeChunk.files[0];
35
35
  const originalSource = compilation.assets[runtimeChunkName].source();
36
- const newSource = originalSource.replace('{{--preload-chunk-graph-object}}', `${JSON.stringify(chunkGraph)}`); // Update the runtime asset with injected code
36
+ const newSource = originalSource.replace('__PRELOAD_CHUNK_GRAPH__', `${JSON.stringify(chunkGraph)}`); // Update the runtime asset with injected code
37
37
 
38
38
  compilation.updateAsset(runtimeChunkName, new RawSource(newSource));
39
+
40
+ if (runtimeChunkName.includes('smap/')) {
41
+ compilation.updateAsset(runtimeChunkName.replace('smap/', ''), new RawSource(newSource));
42
+ }
39
43
  });
40
44
  });
41
45
  }
@@ -145,7 +145,7 @@ class ResourceHintsRuntimePlugin extends _webpack.RuntimeModule {
145
145
 
146
146
  // Preload a chunk (${pluginName})
147
147
  ${_webpack.RuntimeGlobals.require}.plc = function preloadChunk(chunkId) {
148
- const preloadChunkGraph = {{--preload-chunk-graph-object}}
148
+ const preloadChunkGraph = __PRELOAD_CHUNK_GRAPH__
149
149
  ${`
150
150
  if (typeof preloadChunkGraph !== 'object' || !preloadChunkGraph) return;
151
151
  preloadChunkGraph[chunkId].forEach(idOfAChunk => {
@@ -15,7 +15,7 @@ function getCssLoaderOptions(options) {
15
15
  modules: {
16
16
  getLocalIdent: (0, _cssClassNameGenerate.default)(options)
17
17
  },
18
- sourceMap: true
18
+ sourceMap: false
19
19
  };
20
20
  return cssLoaderOptions;
21
21
  }
@@ -27,7 +27,17 @@ function outputConfig(options) {
27
27
  chunkLoadingGlobal: (0, _modeUtils.getGlobalCacheStorageName)(options),
28
28
  publicPath,
29
29
  // clean: true,
30
- path: _path.default.resolve(_constants.appPath, output)
30
+ path: _path.default.resolve(_constants.appPath, output),
31
+ devtoolModuleFilenameTemplate: info => {
32
+ let resourcePath = info.resourcePath;
33
+ const namespace = info.namespace;
34
+
35
+ if (resourcePath.startsWith('./')) {
36
+ resourcePath = resourcePath.substring(2);
37
+ }
38
+
39
+ return `webpack://${namespace}/${resourcePath}`;
40
+ }
31
41
  };
32
42
 
33
43
  if (htmlTemplate.crossorigin) {
@@ -13,7 +13,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
13
13
 
14
14
  /* eslint-disable no-use-before-define */
15
15
  function configChunkHierarchyPlugin(options) {
16
- if (options.chunkGraph.enable && (0, _modeUtils.isProductionMode)(options.mode)) {
16
+ if (options.chunkGraph.enable) {
17
17
  return new _ChunkHierarchyPlugin.default(options.chunkGraph.fileName);
18
18
  }
19
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.15",
3
+ "version": "0.0.16-exp.1",
4
4
  "description": "A CLI tool to build web applications and client libraries",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -17,7 +17,7 @@
17
17
  "test": "react-cli test"
18
18
  },
19
19
  "repository": {
20
- "type": "git",
20
+ "type": "git",
21
21
  "url": "https://zgit.csecz.zohocorpin.com/zohodesk/react-cli.git"
22
22
  },
23
23
  "keywords": [