@zohodesk/client_build_tool 0.0.11-exp.15.4 → 0.0.11-exp.16.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.
Files changed (224) hide show
  1. package/README.md +102 -0
  2. package/README_backup.md +100 -0
  3. package/docs/DYNAMIC_TEMPLATE_EXAMPLE.md +129 -0
  4. package/docs/I18N_SINGLE_FILE_MODE.md +126 -0
  5. package/example-single-file-config.js +59 -0
  6. package/lib/allCommandsConfigs.js +2 -7
  7. package/lib/commands/build/commandExecutor.js +1 -5
  8. package/lib/commands/build/config.js +2 -3
  9. package/lib/commands/build/optionsProcessor.js +2 -5
  10. package/lib/commands/build/preProcessor.js +0 -2
  11. package/lib/commands/buildEs/commandExecutor.js +0 -5
  12. package/lib/commands/buildEs/config.js +2 -3
  13. package/lib/commands/buildEs/preProcessor.js +0 -2
  14. package/lib/commands/buildLib/commandExecutor.js +0 -5
  15. package/lib/commands/buildLib/config.js +2 -3
  16. package/lib/commands/buildLib/preProcessor.js +0 -2
  17. package/lib/commands/mockserver/commandExecutor.js +2 -9
  18. package/lib/commands/mockserver/config.js +2 -3
  19. package/lib/commands/pre_process/commandExecutor.js +0 -2
  20. package/lib/commands/pre_process/config.js +2 -3
  21. package/lib/commands/start/commandExecutor.js +0 -2
  22. package/lib/commands/start/config.js +2 -3
  23. package/lib/commands/start/optionsProcessor.js +2 -4
  24. package/lib/commands/start/preProcessor.js +0 -2
  25. package/lib/commands/template/commandExecutor.js +0 -7
  26. package/lib/commands/template/config.js +2 -3
  27. package/lib/commands/version/commandExecutor.js +0 -3
  28. package/lib/commands/version/config.js +2 -3
  29. package/lib/commandsRouter.js +5 -21
  30. package/lib/index.js +0 -2
  31. package/lib/logger.js +0 -5
  32. package/lib/schemas/applyValuesToSchema/index.js +0 -8
  33. package/lib/schemas/applyValuesToSchema/isObject.js +0 -1
  34. package/lib/schemas/applyValuesToSchema/isValid.js +0 -2
  35. package/lib/schemas/cliArgsToObject.js +2 -6
  36. package/lib/schemas/defaultConfigValues.js +21 -12
  37. package/lib/schemas/defaultConfigValuesOnly.js +4 -7
  38. package/lib/schemas/deprecatedOptionsHandler.js +7 -16
  39. package/lib/schemas/getNpmVersion.js +0 -5
  40. package/lib/schemas/giveDefaultValue.js +0 -3
  41. package/lib/schemas/npmConfigToObject.js +2 -5
  42. package/lib/schemas/readOptions.js +10 -30
  43. package/lib/schemas/readOptionsForConfigFile.js +2 -12
  44. package/lib/shared/babel/addDefaultPlugins.js +0 -2
  45. package/lib/shared/babel/babelWebConfig.js +1 -10
  46. package/lib/shared/babel/babel_plugins/removeAttributesPlugin.js +0 -4
  47. package/lib/shared/babel/getBabelPlugin.js +2 -7
  48. package/lib/shared/babel/runBabelForJSFile.js +1 -4
  49. package/lib/shared/babel/runBabelForTsFile.js +1 -5
  50. package/lib/shared/bundler/webpack/common/decidePublicPath.js +0 -5
  51. package/lib/shared/bundler/webpack/common/libAlias.js +3 -3
  52. package/lib/shared/bundler/webpack/common/modeUtils.js +0 -5
  53. package/lib/shared/bundler/webpack/common/nameTemplates.js +11 -18
  54. package/lib/shared/bundler/webpack/common/resourceBasedPublicPath.js +2 -3
  55. package/lib/shared/bundler/webpack/configCustomLoaders.js +0 -1
  56. package/lib/shared/bundler/webpack/cssLoaders.js +0 -2
  57. package/lib/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/index.js +1 -20
  58. package/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin/index.js +20 -25
  59. package/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin/webpackCustomJsUrlLoader.js +4 -9
  60. package/lib/shared/bundler/webpack/custom_plugins/CustomScriptLoadingPlugin.js +3 -23
  61. package/lib/shared/bundler/webpack/custom_plugins/EFCTemplatePlugin.js +8 -19
  62. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nGroupRuntimeModule.js +2 -6
  63. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexHtmlInjectorPlugin.js +81 -0
  64. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexPlugin.js +135 -60
  65. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/utils/i18nDataLoader.js +20 -26
  66. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nFilesEmitPlugin.js +5 -26
  67. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +13 -16
  68. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nRuntimeDealerPlugin.js +19 -53
  69. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/LocaleChunkAssetsStore.js +2 -17
  70. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ModulesI18nKeysStore.js +0 -13
  71. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +11 -21
  72. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +0 -4
  73. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +4 -14
  74. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +3 -13
  75. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/iterateModulesInChunk.js +3 -12
  76. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +2 -7
  77. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +0 -2
  78. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +2 -3
  79. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +2 -4
  80. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +8 -13
  81. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +2 -14
  82. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/getChunkModules.js +0 -1
  83. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +1 -3
  84. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +0 -4
  85. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +5 -25
  86. package/lib/shared/bundler/webpack/custom_plugins/InitialHtmlPlugin.js +3 -10
  87. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/addFilesNamesToManifestJson.js +1 -6
  88. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createInitialEntries.js +1 -6
  89. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createManifestJson.js +0 -6
  90. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/findInitialFileNames.js +0 -1
  91. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/index.js +0 -7
  92. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/removeHashFromFileName.js +0 -1
  93. package/lib/shared/bundler/webpack/custom_plugins/ResourceHintsPlugin.js +13 -17
  94. package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +6 -15
  95. package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +4 -13
  96. package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +4 -6
  97. package/lib/shared/bundler/webpack/custom_plugins/RuntimeResourceCleanup/index.js +0 -10
  98. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/classHandling.js +0 -3
  99. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/index.js +4 -20
  100. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/selectorWeightPrefixAdder.js +10 -12
  101. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/windowsModification.js +2 -3
  102. package/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +7 -20
  103. package/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPluginUtils.js +0 -1
  104. package/lib/shared/bundler/webpack/custom_plugins/SourceMapPlugin/index.js +7 -10
  105. package/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/addHashToFilePath.js +1 -6
  106. package/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/index.js +1 -16
  107. package/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/index.js.js +4 -11
  108. package/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/ErrorHandler.js +3 -10
  109. package/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/index.js +27 -62
  110. package/lib/shared/bundler/webpack/custom_plugins/custom_attribute_plugin/index.js +3 -15
  111. package/lib/shared/bundler/webpack/custom_plugins/emitAsset.js +0 -1
  112. package/lib/shared/bundler/webpack/custom_plugins/getInitialAssetsFuncTemplate.js +2 -12
  113. package/lib/shared/bundler/webpack/custom_plugins/getInitialI18nAssetsArrayStr.js +2 -7
  114. package/lib/shared/bundler/webpack/defaultVendorPatternList.js +2 -6
  115. package/lib/shared/bundler/webpack/devtoolConfig.js +0 -1
  116. package/lib/shared/bundler/webpack/entryConfig.js +0 -4
  117. package/lib/shared/bundler/webpack/externals.js +0 -1
  118. package/lib/shared/bundler/webpack/getCSSLoaders.js +1 -6
  119. package/lib/shared/bundler/webpack/getFilenameFromModule.js +1 -5
  120. package/lib/shared/bundler/webpack/jsLoaders.js +6 -10
  121. package/lib/shared/bundler/webpack/loaderConfigs/assetLoaders.js +0 -2
  122. package/lib/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +2 -3
  123. package/lib/shared/bundler/webpack/loaderConfigs/checkIsPatternsMatchFilename.js +3 -12
  124. package/lib/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +0 -1
  125. package/lib/shared/bundler/webpack/loaderConfigs/configPostCssLoader.js +2 -10
  126. package/lib/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +0 -2
  127. package/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +0 -12
  128. package/lib/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +1 -15
  129. package/lib/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +1 -4
  130. package/lib/shared/bundler/webpack/loaderConfigs/i18nIdReplaceLoaderConfig.js +8 -16
  131. package/lib/shared/bundler/webpack/loaders/i18nIdReplaceLoader.js +22 -29
  132. package/lib/shared/bundler/webpack/loaders/miniCssFallBackLoader.js +2 -2
  133. package/lib/shared/bundler/webpack/loaders/workerLoader.js +8 -19
  134. package/lib/shared/bundler/webpack/optimizationConfig.js +5 -13
  135. package/lib/shared/bundler/webpack/outputConfig.js +1 -9
  136. package/lib/shared/bundler/webpack/pluginConfigs/configBundleAnalyzer.js +5 -9
  137. package/lib/shared/bundler/webpack/pluginConfigs/configBundleIntegrityReport.js +0 -5
  138. package/lib/shared/bundler/webpack/pluginConfigs/configCSSMinifierPlugin.js +4 -9
  139. package/lib/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +3 -8
  140. package/lib/shared/bundler/webpack/pluginConfigs/configCopyPublicFolders.js +1 -16
  141. package/lib/shared/bundler/webpack/pluginConfigs/configCustomAttributesPlugin.js +0 -4
  142. package/lib/shared/bundler/webpack/pluginConfigs/configCustomScriptLoadingStrategyPlugin.js +0 -16
  143. package/lib/shared/bundler/webpack/pluginConfigs/configEFCTemplatePlugin.js +0 -5
  144. package/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +0 -5
  145. package/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +2 -8
  146. package/lib/shared/bundler/webpack/pluginConfigs/configI18nIndexingPlugin.js +5 -9
  147. package/lib/shared/bundler/webpack/pluginConfigs/configI18nNumericHtmlInjector.js +19 -25
  148. package/lib/shared/bundler/webpack/pluginConfigs/configI18nNumericIndexPlugin.js +92 -0
  149. package/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +3 -9
  150. package/lib/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +0 -2
  151. package/lib/shared/bundler/webpack/pluginConfigs/configManifestJsonPlugin.js +0 -7
  152. package/lib/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +3 -7
  153. package/lib/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +1 -5
  154. package/lib/shared/bundler/webpack/pluginConfigs/configResourceHintsPlugin.js +1 -4
  155. package/lib/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +0 -4
  156. package/lib/shared/bundler/webpack/pluginConfigs/configRuntimeResourceCleanup.js +3 -8
  157. package/lib/shared/bundler/webpack/pluginConfigs/configSelectorWeightPlugin.js +1 -6
  158. package/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +3 -8
  159. package/lib/shared/bundler/webpack/pluginConfigs/configSourceMapPlugin.js +0 -4
  160. package/lib/shared/bundler/webpack/pluginConfigs/configTPHashMappingPlugin.js +1 -8
  161. package/lib/shared/bundler/webpack/pluginConfigs/configVariableConversionPlugin.js +1 -6
  162. package/lib/shared/bundler/webpack/plugins.js +3 -30
  163. package/lib/shared/bundler/webpack/resolvers.js +3 -17
  164. package/lib/shared/bundler/webpack/splitChunksConfig.js +2 -15
  165. package/lib/shared/bundler/webpack/statsConfig.js +2 -5
  166. package/lib/shared/bundler/webpack/tsLoaders.js +2 -4
  167. package/lib/shared/bundler/webpack/utils/index.js +1 -12
  168. package/lib/shared/bundler/webpack/utils/object-manipulation.js +2 -16
  169. package/lib/shared/bundler/webpack/utils/updateArrayWithDefault.js +0 -7
  170. package/lib/shared/bundler/webpack/webpackBuild.js +1 -8
  171. package/lib/shared/bundler/webpack/webpackConfig.js +0 -17
  172. package/lib/shared/commands-utils/doBasicRequirementCheck.js +0 -3
  173. package/lib/shared/commands-utils/getCliPath.js +5 -9
  174. package/lib/shared/commands-utils/index.js +0 -3
  175. package/lib/shared/commands-utils/log.js +0 -2
  176. package/lib/shared/commands-utils/readArgsFormCommandLine.js +0 -1
  177. package/lib/shared/commands-utils/readOptionFormCommandLine.js +0 -1
  178. package/lib/shared/commands-utils/spawnSyncIO.js +5 -13
  179. package/lib/shared/constants.js +9 -29
  180. package/lib/shared/fileUtils/copyFile.js +1 -8
  181. package/lib/shared/fileUtils/directoryIterator.js +0 -4
  182. package/lib/shared/fileUtils/watchRun.js +3 -24
  183. package/lib/shared/postcss/custom_postcss_plugins/EmptyPlugin.js +1 -6
  184. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/constants.js +2 -3
  185. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/handleIgnores.js +6 -13
  186. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/index.js +6 -26
  187. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/insertBefore.js +6 -9
  188. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/isPreviouslyProcessed.js +0 -3
  189. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/replaceUtils.js +2 -7
  190. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/separateHoveredSelectorAndNormalSelector.js +0 -2
  191. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/specialCases.js +4 -9
  192. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/typeCheckUtils.js +0 -10
  193. package/lib/shared/postcss/custom_postcss_plugins/RTLSplitPlugin.js +16 -29
  194. package/lib/shared/postcss/custom_postcss_plugins/SelectorReplace.js +0 -17
  195. package/lib/shared/postcss/custom_postcss_plugins/ValueReplacer.js +4 -9
  196. package/lib/shared/postcss/custom_postcss_plugins/VariableModificationPlugin/index.js +27 -63
  197. package/lib/shared/postcss/filterPluginsAllowedForSpecficFile.js +5 -13
  198. package/lib/shared/postcss/getAllowedPostCssPlugins.js +0 -3
  199. package/lib/shared/postcss/getSpecificPostCssPlugin.js +7 -17
  200. package/lib/shared/postcss/runPostCssForCssFile.js +1 -9
  201. package/lib/shared/pre_process/runPreProcess.js +0 -11
  202. package/lib/shared/server/configWebpackDevMiddleware.js +1 -8
  203. package/lib/shared/server/corsHandling.js +2 -6
  204. package/lib/shared/server/getIp.js +1 -7
  205. package/lib/shared/server/getServerURL.js +0 -6
  206. package/lib/shared/server/httpsOptions.js +0 -11
  207. package/lib/shared/server/initExpressApp.js +1 -4
  208. package/lib/shared/server/initialHTMLHandling.js +7 -16
  209. package/lib/shared/server/mockApiHandler.js +8 -16
  210. package/lib/shared/server/mockServer.js +0 -7
  211. package/lib/shared/server/serveContextFiles.js +1 -5
  212. package/lib/shared/server/serverBywebpackDevMiddleware.js +4 -9
  213. package/lib/shared/server/startHttpServer.js +0 -3
  214. package/lib/shared/server/startHttpsServer.js +1 -9
  215. package/lib/shared/server/unwanted/addHttp2Server.js +2 -7
  216. package/lib/shared/server/unwanted/configWebpackDevMiddleware.js +1 -8
  217. package/lib/shared/server/unwanted/mockApiSupport.js +0 -2
  218. package/lib/shared/server/unwanted/websocketMockSetup.js +1 -7
  219. package/lib/shared/server/urlConcat.js +3 -8
  220. package/lib/shared/utils/requireLocalOrGlobal.js +10 -25
  221. package/lib/shared/utils/versionPrint.js +1 -6
  222. package/npm-shrinkwrap.json +2 -2
  223. package/package.json +1 -1
  224. package/packages/client_build_tool/test-i18n-config.js +22 -0
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configResourceHintsPlugin = configResourceHintsPlugin;
7
-
8
7
  var _ResourceHintsPlugin = _interopRequireDefault(require("../custom_plugins/ResourceHintsPlugin"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
9
  function configResourceHintsPlugin(options) {
13
10
  const {
14
11
  publicPath,
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configRtlCssPlugin = configRtlCssPlugin;
7
-
8
7
  var _RtlCssPlugin = require("../custom_plugins/RtlSplitPlugin/RtlCssPlugin");
9
-
10
8
  function configRtlCssPlugin(options) {
11
9
  const {
12
10
  enableRTLSplit,
@@ -14,11 +12,9 @@ function configRtlCssPlugin(options) {
14
12
  disableMinifySelector,
15
13
  dirVarName
16
14
  } = options.css.plugins.rtlSplit;
17
-
18
15
  if (!enableRTLSplit) {
19
16
  return null;
20
17
  }
21
-
22
18
  return new _RtlCssPlugin.RtlCssPlugin({
23
19
  templateLabel,
24
20
  disableMinifySelector,
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configRuntimeResourceCleanup = configRuntimeResourceCleanup;
7
-
8
7
  var _modeUtils = require("../common/modeUtils");
9
-
10
8
  var _RuntimeResourceCleanup = _interopRequireDefault(require("../custom_plugins/RuntimeResourceCleanup"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
10
  function configRuntimeResourceCleanup(options) {
15
11
  const chunkLoadingGlobal = (0, _modeUtils.getGlobalCacheStorageName)(options);
16
12
  const {
@@ -20,12 +16,11 @@ function configRuntimeResourceCleanup(options) {
20
16
  const {
21
17
  customAttributes = {}
22
18
  } = options;
23
-
24
19
  if (efcEnabled && runtimeResourceCleanupEnabled) {
25
- return new _RuntimeResourceCleanup.default({ ...customAttributes,
20
+ return new _RuntimeResourceCleanup.default({
21
+ ...customAttributes,
26
22
  chunkLoadingGlobal
27
23
  });
28
24
  }
29
-
30
25
  return null;
31
26
  }
@@ -4,20 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configSelectorWeightPlugin = configSelectorWeightPlugin;
7
-
8
7
  var _SelectorWeightPlugin = _interopRequireDefault(require("../custom_plugins/SelectorWeightPlugin"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
9
  function configSelectorWeightPlugin(options) {
13
10
  const {
14
11
  selectorWeight
15
12
  } = options.css.plugins;
16
-
17
13
  if (!selectorWeight.enable) {
18
14
  return null;
19
15
  }
20
-
21
16
  return new _SelectorWeightPlugin.default({
22
17
  selectorWeightConfig: selectorWeight.configFile,
23
18
  defaultSelector: selectorWeight.defaultSelector,
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configServiceWorkerPlugin = configServiceWorkerPlugin;
7
-
8
7
  var _nameTemplates = require("../common/nameTemplates");
9
-
10
8
  var _ServiceWorkerPlugin = _interopRequireDefault(require("../custom_plugins/ServiceWorkerPlugin"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
10
  function configServiceWorkerPlugin(options) {
15
11
  const {
16
12
  serviceWorker
@@ -24,13 +20,12 @@ function configServiceWorkerPlugin(options) {
24
20
  const {
25
21
  enableRTLSplit
26
22
  } = options.css.plugins.rtlSplit;
27
-
28
23
  if (!serviceWorker.enable) {
29
24
  return null;
30
25
  }
31
-
32
26
  const i18nFileNameTemplate = (0, _nameTemplates.nameTemplates)('i18njs', options);
33
- return new _ServiceWorkerPlugin.default({ ...serviceWorker,
27
+ return new _ServiceWorkerPlugin.default({
28
+ ...serviceWorker,
34
29
  publicPath,
35
30
  i18nFileNameTemplate,
36
31
  chunkSplitEnable,
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configSourceMapPlugin = configSourceMapPlugin;
7
-
8
7
  var _SourceMapPlugin = require("../custom_plugins/SourceMapPlugin");
9
-
10
8
  function configSourceMapPlugin(options) {
11
9
  const {
12
10
  createSeparateSMap
13
11
  } = options;
14
-
15
12
  if (createSeparateSMap === false) {
16
13
  return null;
17
14
  }
18
-
19
15
  return new _SourceMapPlugin.SourceMapPlugin();
20
16
  }
@@ -4,29 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configTPHashMappingPlugin = configTPHashMappingPlugin;
7
-
8
7
  var _path = _interopRequireDefault(require("path"));
9
-
10
8
  var _TPHashMappingPlugin = require("../custom_plugins/TPHashMappingPlugin");
11
-
12
9
  var _modeUtils = require("../common/modeUtils");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
11
  function configTPHashMappingPlugin(options) {
17
12
  const {
18
13
  fileHashMappingToVariable,
19
14
  context,
20
15
  mode
21
16
  } = options;
22
-
23
17
  if ((0, _modeUtils.isProductionMode)(mode) && fileHashMappingToVariable) {
24
18
  return new _TPHashMappingPlugin.TPHashMappingPlugin({
25
19
  fileMappings: fileHashMappingToVariable,
26
20
  tpFolder: `${_path.default.join(process.cwd(), context)}`
27
21
  });
28
22
  }
29
-
30
23
  ;
31
24
  return null;
32
25
  }
@@ -4,20 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configVariableConversionPlugin = configVariableConversionPlugin;
7
-
8
7
  var _VariableConversionCollector = _interopRequireDefault(require("../custom_plugins/VariableConversionCollector"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
9
  function configVariableConversionPlugin(options) {
13
10
  const {
14
11
  cssVariableReplacement
15
12
  } = options.css.plugins;
16
-
17
13
  if (cssVariableReplacement.enable === false) {
18
14
  return false;
19
15
  }
20
-
21
16
  return new _VariableConversionCollector.default({
22
17
  configFile: cssVariableReplacement.configFile,
23
18
  patterns: cssVariableReplacement.patterns
@@ -4,61 +4,34 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.plugins = plugins;
7
-
8
7
  var _configHtmlWebpackPlugin = require("./pluginConfigs/configHtmlWebpackPlugin");
9
-
10
8
  var _configEnvVariables = require("./pluginConfigs/configEnvVariables");
11
-
12
9
  var _configI18nSplitPlugin = require("./pluginConfigs/configI18nSplitPlugin");
13
-
14
- var _configI18nIndexingPlugin = _interopRequireDefault(require("./pluginConfigs/configI18nIndexingPlugin"));
15
-
16
- var _configI18nNumericHtmlInjector = _interopRequireDefault(require("./pluginConfigs/configI18nNumericHtmlInjector"));
17
-
10
+ var _configI18nNumericIndexPlugin = require("./pluginConfigs/configI18nNumericIndexPlugin");
18
11
  var _configMiniCSSExtractPlugin = require("./pluginConfigs/configMiniCSSExtractPlugin");
19
-
20
12
  var _configRtlCssPlugin = require("./pluginConfigs/configRtlCssPlugin");
21
-
22
13
  var _configIgnorePlugin = require("./pluginConfigs/configIgnorePlugin");
23
-
24
14
  var _configCdnChangePlugin = require("./pluginConfigs/configCdnChangePlugin");
25
-
26
15
  var _configServiceWorkerPlugin = require("./pluginConfigs/configServiceWorkerPlugin");
27
-
28
16
  var _configProgressPlugin = require("./pluginConfigs/configProgressPlugin");
29
-
30
17
  var _configBundleAnalyzer = require("./pluginConfigs/configBundleAnalyzer");
31
-
32
18
  var _configSelectorWeightPlugin = require("./pluginConfigs/configSelectorWeightPlugin");
33
-
34
19
  var _configVariableConversionPlugin = require("./pluginConfigs/configVariableConversionPlugin");
35
-
36
20
  var _configEFCTemplatePlugin = require("./pluginConfigs/configEFCTemplatePlugin");
37
-
38
21
  var _configResourceHintsPlugin = require("./pluginConfigs/configResourceHintsPlugin");
39
-
40
22
  var _configManifestJsonPlugin = require("./pluginConfigs/configManifestJsonPlugin");
41
-
42
23
  var _configCopyPublicFolders = require("./pluginConfigs/configCopyPublicFolders");
43
-
44
24
  var _configSourceMapPlugin = require("./pluginConfigs/configSourceMapPlugin");
45
-
46
25
  var _configTPHashMappingPlugin = require("./pluginConfigs/configTPHashMappingPlugin");
47
-
48
26
  var _configCustomAttributesPlugin = require("./pluginConfigs/configCustomAttributesPlugin");
49
-
50
27
  var _configBundleIntegrityReport = require("./pluginConfigs/configBundleIntegrityReport");
51
-
52
28
  var _configRuntimeResourceCleanup = require("./pluginConfigs/configRuntimeResourceCleanup");
53
-
54
29
  var _configCustomScriptLoadingStrategyPlugin = require("./pluginConfigs/configCustomScriptLoadingStrategyPlugin");
55
-
56
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
57
-
58
30
  // import { IgnorePlugin } from 'webpack';
31
+
59
32
  function plugins(options) {
60
33
  const {
61
34
  webpackPlugins
62
35
  } = options;
63
- return [(0, _configEnvVariables.configEnvVariables)(options), (0, _configCustomAttributesPlugin.configCustomAttributesPlugin)(options), (0, _configTPHashMappingPlugin.configTPHashMappingPlugin)(options), (0, _configCopyPublicFolders.configCopyPublicFolders)(options), (0, _configIgnorePlugin.configIgnorePlugin)(options), (0, _configMiniCSSExtractPlugin.configMiniCSSExtractPlugin)(options), (0, _configSelectorWeightPlugin.configSelectorWeightPlugin)(options), (0, _configVariableConversionPlugin.configVariableConversionPlugin)(options), (0, _configI18nSplitPlugin.configI18nSplitPlugin)(options), (0, _configI18nIndexingPlugin.default)(options), (0, _configRtlCssPlugin.configRtlCssPlugin)(options), (0, _configHtmlWebpackPlugin.configHtmlWebpackPlugin)(options), (0, _configI18nNumericHtmlInjector.default)(options), (0, _configCustomScriptLoadingStrategyPlugin.configCustomScriptLoadingStrategyPlugin)(options), (0, _configCdnChangePlugin.configCdnChangePlugin)(options), (0, _configServiceWorkerPlugin.configServiceWorkerPlugin)(options), (0, _configEFCTemplatePlugin.configEFCTemplatePlugin)(options), (0, _configResourceHintsPlugin.configResourceHintsPlugin)(options), (0, _configBundleAnalyzer.configBundleAnalyzer)(options), (0, _configManifestJsonPlugin.configManifestJsonPlugin)(options), (0, _configSourceMapPlugin.configSourceMapPlugin)(options), (0, _configProgressPlugin.configProgressPlugin)(options), (0, _configBundleIntegrityReport.configBundleIntegrityReport)(options), (0, _configRuntimeResourceCleanup.configRuntimeResourceCleanup)(options), ...webpackPlugins].filter(Boolean);
36
+ return [(0, _configEnvVariables.configEnvVariables)(options), (0, _configCustomAttributesPlugin.configCustomAttributesPlugin)(options), (0, _configTPHashMappingPlugin.configTPHashMappingPlugin)(options), (0, _configCopyPublicFolders.configCopyPublicFolders)(options), (0, _configIgnorePlugin.configIgnorePlugin)(options), (0, _configMiniCSSExtractPlugin.configMiniCSSExtractPlugin)(options), (0, _configSelectorWeightPlugin.configSelectorWeightPlugin)(options), (0, _configVariableConversionPlugin.configVariableConversionPlugin)(options), (0, _configI18nSplitPlugin.configI18nSplitPlugin)(options), ...((0, _configI18nNumericIndexPlugin.configI18nNumericIndexPlugin)(options) || []), (0, _configRtlCssPlugin.configRtlCssPlugin)(options), (0, _configHtmlWebpackPlugin.configHtmlWebpackPlugin)(options), (0, _configCustomScriptLoadingStrategyPlugin.configCustomScriptLoadingStrategyPlugin)(options), (0, _configCdnChangePlugin.configCdnChangePlugin)(options), (0, _configServiceWorkerPlugin.configServiceWorkerPlugin)(options), (0, _configEFCTemplatePlugin.configEFCTemplatePlugin)(options), (0, _configResourceHintsPlugin.configResourceHintsPlugin)(options), (0, _configBundleAnalyzer.configBundleAnalyzer)(options), (0, _configManifestJsonPlugin.configManifestJsonPlugin)(options), (0, _configSourceMapPlugin.configSourceMapPlugin)(options), (0, _configProgressPlugin.configProgressPlugin)(options), (0, _configBundleIntegrityReport.configBundleIntegrityReport)(options), (0, _configRuntimeResourceCleanup.configRuntimeResourceCleanup)(options), ...webpackPlugins].filter(Boolean);
64
37
  }
@@ -5,51 +5,38 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.loaderResolver = loaderResolver;
7
7
  exports.moduleResolver = moduleResolver;
8
-
9
8
  var _client_packages_group = require("@zohodesk/client_packages_group");
10
-
11
9
  var _constants = require("../../constants");
12
-
13
10
  var _libAlias = require("./common/libAlias");
14
-
15
11
  var _requireLocalOrGlobal = require("../../utils/requireLocalOrGlobal");
16
-
17
12
  var _logger = require("../../../logger");
18
-
19
13
  /* eslint-disable no-use-before-define */
20
- const defaultPackageGroupNpm = '@zohodesk/client_packages_group';
21
14
 
15
+ const defaultPackageGroupNpm = '@zohodesk/client_packages_group';
22
16
  function decideNodeModulesPath(moduleResolvePath) {
23
17
  if (typeof moduleResolvePath === 'string' && moduleResolvePath) {
24
18
  const resolverPkg = (0, _requireLocalOrGlobal.requireAllPossible)(moduleResolvePath);
25
-
26
19
  if (resolverPkg.local) {
27
20
  (0, _logger.verboseLogger)(`Local '${moduleResolvePath}' package taken as Module Resolver`);
28
21
  return resolverPkg.local.nodeModulesPath;
29
22
  }
30
-
31
23
  if (resolverPkg.global) {
32
24
  (0, _logger.messageLogger)(`Global '${moduleResolvePath}' package taken as Module Resolver`);
33
25
  return resolverPkg.global.nodeModulesPath;
34
26
  }
35
-
36
27
  (0, _logger.errorLogger)(`
37
28
  You have given 'resolve.moduleResolvePath' as "${moduleResolvePath}".
38
29
  But it seems that file path have some problem;`);
39
30
  process.exit(0);
40
31
  }
41
-
42
32
  const globalResolverPkg = (0, _requireLocalOrGlobal.requireGlobal)(defaultPackageGroupNpm);
43
-
44
33
  if (globalResolverPkg) {
45
34
  (0, _logger.messageLogger)(`Global '${defaultPackageGroupNpm}' package taken as Module Resolver`);
46
35
  return globalResolverPkg.nodeModulesPath;
47
36
  }
48
-
49
37
  (0, _logger.verboseLogger)(`CBT default '${defaultPackageGroupNpm}' package taken as Module Resolver`);
50
38
  return _client_packages_group.nodeModulesPath;
51
39
  }
52
-
53
40
  function moduleResolver(options) {
54
41
  const {
55
42
  preferLocalFirst,
@@ -60,13 +47,13 @@ function moduleResolver(options) {
60
47
  const nodeModulesPath = decideNodeModulesPath(moduleResolvePath);
61
48
  return {
62
49
  modules: useAppNodeModulesAsPreferred(preferLocalFirst, [nodeModulesPath, _constants.cliNodeModulesPath].filter(Boolean)),
63
- alias: { ...(defaultAlias ? _libAlias.libAlias : {}),
50
+ alias: {
51
+ ...(defaultAlias ? _libAlias.libAlias : {}),
64
52
  ...(alias || {})
65
53
  },
66
54
  extensions: ['.ts', '.js', '.json', '.tsx']
67
55
  };
68
56
  }
69
-
70
57
  function loaderResolver(options) {
71
58
  const {
72
59
  preferLocalFirst
@@ -75,7 +62,6 @@ function loaderResolver(options) {
75
62
  modules: useAppNodeModulesAsPreferred(preferLocalFirst, [_constants.cliNodeModulesPath])
76
63
  };
77
64
  }
78
-
79
65
  function useAppNodeModulesAsPreferred(preferLocalFirst = false, paths = []) {
80
66
  const filteredPaths = paths.filter(Boolean);
81
67
  return preferLocalFirst ? ['node_modules', ...filteredPaths, _constants.appNodeModules] : [...filteredPaths, 'node_modules', _constants.appNodeModules];
@@ -4,31 +4,24 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.splitChunksConfig = splitChunksConfig;
7
-
8
7
  var _defaultVendorPatternList = require("./defaultVendorPatternList");
9
-
10
8
  var _getFilenameFromModule = require("./getFilenameFromModule");
11
-
12
9
  var _checkIsPatternsMatchFilename = require("./loaderConfigs/checkIsPatternsMatchFilename");
13
-
14
10
  function splitChunksConfig(options) {
15
11
  const {
16
12
  vendorPatterns,
17
13
  customChunks,
18
14
  customChunksBaseConfig
19
15
  } = options;
20
-
21
16
  const isVendor = function isVendor(webpackModule) {
22
17
  const userRequest = (0, _getFilenameFromModule.getFilenameFromModule)(webpackModule);
23
18
  const patterns = [..._defaultVendorPatternList.defaultVendorPatternList, ...vendorPatterns];
24
19
  return (0, _checkIsPatternsMatchFilename.checkIsPatternsMatchFilename)(patterns, userRequest);
25
20
  };
26
-
27
21
  const isReact = webpackModule => {
28
22
  const userRequest = (0, _getFilenameFromModule.getFilenameFromModule)(webpackModule);
29
23
  return (0, _checkIsPatternsMatchFilename.checkIsPatternsMatchFilename)(_defaultVendorPatternList.reactBundleIncludeList, userRequest);
30
24
  };
31
-
32
25
  const defaultChunks = {
33
26
  'react.vendor': {
34
27
  name: 'react.vendor',
@@ -48,8 +41,8 @@ function splitChunksConfig(options) {
48
41
  };
49
42
  const customChunksConfig = {};
50
43
  customChunks.reverse().forEach((cacheGroupObj, index) => {
51
- const cacheGroupName = cacheGroupObj.cacheGroupName || cacheGroupObj.name; // eslint-disable-next-line no-use-before-define
52
-
44
+ const cacheGroupName = cacheGroupObj.cacheGroupName || cacheGroupObj.name;
45
+ // eslint-disable-next-line no-use-before-define
53
46
  const obj = getCacheGroup(cacheGroupObj, index);
54
47
  customChunksConfig[cacheGroupName] = obj;
55
48
  });
@@ -65,7 +58,6 @@ function splitChunksConfig(options) {
65
58
  };
66
59
  return splitChunksConfig;
67
60
  }
68
-
69
61
  function getCacheGroup(obj, index) {
70
62
  let {
71
63
  minChunks,
@@ -95,22 +87,17 @@ function getCacheGroup(obj, index) {
95
87
  priority,
96
88
  enforce
97
89
  };
98
-
99
90
  if (minSize !== undefined) {
100
91
  cacheGroup.minSize = minSize;
101
92
  }
102
-
103
93
  if (maxSize !== undefined) {
104
94
  cacheGroup.maxSize = maxSize;
105
95
  }
106
-
107
96
  if (reuseExistingChunk !== undefined) {
108
97
  cacheGroup.reuseExistingChunk = reuseExistingChunk;
109
98
  }
110
-
111
99
  if (automaticNameDelimiter !== undefined) {
112
100
  cacheGroup.automaticNameDelimiter = automaticNameDelimiter;
113
101
  }
114
-
115
102
  return cacheGroup;
116
103
  }
@@ -4,27 +4,24 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.statsConfig = statsConfig;
7
-
8
7
  // eslint-disable-next-line no-unused-vars
9
8
  function statsConfig(options) {
10
9
  let {
11
10
  statsLogConfig
12
11
  } = options;
13
12
  statsLogConfig = statsLogConfig || {};
14
-
15
13
  if (typeof statsLogConfig === 'string') {
16
14
  return statsLogConfig;
17
15
  }
18
-
19
16
  return {
20
17
  preset: 'minimal',
21
18
  warnings: false,
22
19
  children: false,
23
20
  colors: true,
24
21
  errorDetails: true,
25
- ...statsLogConfig // excludeAssets: /i18n/,
22
+ ...statsLogConfig
23
+ // excludeAssets: /i18n/,
26
24
  // excludeAssets: /./,
27
25
  // warningsFilter: /\[mini-css-extract-plugin\]/
28
-
29
26
  };
30
27
  }
@@ -4,14 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.tsLoaders = tsLoaders;
7
-
8
7
  var _babelLoaderConfig = require("./loaderConfigs/babelLoaderConfig");
9
-
10
8
  function tsLoaders(options) {
11
9
  return [{
12
10
  test: /\.tsx$/,
13
11
  exclude: /node_modules/,
14
- use: [(0, _babelLoaderConfig.babelLoaderConfig)(options)] // include: path.join(appPath, folder)
15
-
12
+ use: [(0, _babelLoaderConfig.babelLoaderConfig)(options)]
13
+ // include: path.join(appPath, folder)
16
14
  }];
17
15
  }
@@ -5,27 +5,16 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getTypeOf = getTypeOf;
7
7
  exports.isJsFile = exports.isDirRelatedCss = exports.isCssFile = exports.isCss = void 0;
8
-
9
8
  var _path = _interopRequireDefault(require("path"));
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
10
  const isCss = filename => _path.default.extname(filename) === '.css';
14
-
15
11
  exports.isCss = isCss;
16
-
17
12
  const isDirRelatedCss = filename => filename.includes('[dir]');
18
-
19
13
  exports.isDirRelatedCss = isDirRelatedCss;
20
-
21
14
  const isJsFile = file => /\.js$/.test(file);
22
-
23
15
  exports.isJsFile = isJsFile;
24
-
25
16
  const isCssFile = file => /\.css$/.test(file);
26
-
27
17
  exports.isCssFile = isCssFile;
28
-
29
18
  function getTypeOf(value) {
30
19
  return Object.prototype.toString.call(value).split(/\s/)[1].replace(/\]/, '').toLowerCase();
31
20
  }
@@ -5,75 +5,62 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.convertObjectToStringGen = convertObjectToStringGen;
7
7
  exports.removeKeysFromObject = removeKeysFromObject;
8
-
9
8
  /* eslint-disable no-restricted-syntax */
9
+
10
10
  function objectPathMatcher(currentKey, objHierarchy = [], keysToBeRemoved = []) {
11
11
  const objPathKey = objHierarchy.length > 0 ? `${objHierarchy.join('.')}.${currentKey}` : currentKey;
12
12
  return keysToBeRemoved.some(key => {
13
13
  const isWildPath = /^\*/.test(key);
14
-
15
14
  if (isWildPath) {
16
15
  const newKey = key.replace(/\*\.?/, '');
17
16
  return objPathKey.includes(newKey);
18
17
  }
19
-
20
18
  return key === objPathKey;
21
19
  });
22
20
  }
21
+
23
22
  /*
24
23
  1) *.keyTobeRemoved -> means match every object path, this key will be removed
25
24
  2) keyToBeremoved -> means root object key
26
25
  3) nestedPath.keyToBeRemoved -> means only that nested path key
27
26
  4) don't need to account for array iteration, just object key path is enough in the key to be removed.
28
27
  */
29
-
30
-
31
28
  function removeKeysFromObject(obj, keysToBeRemoved, prevKeys = []) {
32
29
  if (Array.isArray(obj)) {
33
30
  return obj.map(item => removeKeysFromObject(item, keysToBeRemoved, prevKeys));
34
31
  }
35
-
36
32
  if (obj && typeof obj === 'object') {
37
33
  const filteredKeyObject = {};
38
34
  const ObjectKeys = Object.keys(obj);
39
-
40
35
  for (const objectKey of ObjectKeys) {
41
36
  const isKeyToBeRemoved = objectPathMatcher(objectKey, prevKeys, keysToBeRemoved);
42
-
43
37
  if (!isKeyToBeRemoved) {
44
38
  filteredKeyObject[objectKey] = removeKeysFromObject(obj[objectKey], keysToBeRemoved, [...prevKeys, objectKey]);
45
39
  }
46
40
  }
47
-
48
41
  return filteredKeyObject;
49
42
  }
50
-
51
43
  return obj;
52
44
  }
53
-
54
45
  function* convertObjectToStringGen(obj) {
55
46
  if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || obj === null) {
56
47
  yield JSON.stringify(obj);
57
48
  } else if (Array.isArray(obj)) {
58
49
  yield '[';
59
50
  let isFirst = true;
60
-
61
51
  for (let item of obj) {
62
52
  if (item === undefined) {
63
53
  item = null;
64
54
  }
65
-
66
55
  yield `${isFirst ? '' : ','}`;
67
56
  yield* convertObjectToStringGen(item);
68
57
  isFirst = false;
69
58
  }
70
-
71
59
  yield ']';
72
60
  } else {
73
61
  yield '{';
74
62
  let isFirst = true;
75
63
  const entries = Object.entries(obj);
76
-
77
64
  for (const [itemKey, itemValue] of entries) {
78
65
  if (itemValue !== undefined) {
79
66
  yield `${isFirst ? '' : ','}${JSON.stringify(itemKey)}: `;
@@ -81,7 +68,6 @@ function* convertObjectToStringGen(obj) {
81
68
  isFirst = false;
82
69
  }
83
70
  }
84
-
85
71
  yield '}';
86
72
  }
87
73
  }
@@ -5,28 +5,21 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getArrayWithDefault = getArrayWithDefault;
7
7
  exports.updateArrayWithDefault = updateArrayWithDefault;
8
-
9
8
  function updateArrayWithDefault(array, defaultoptions = []) {
10
9
  const index = array.indexOf('...');
11
-
12
10
  if (index === -1) {
13
11
  return array;
14
12
  }
15
-
16
13
  const newArray = [...array];
17
14
  newArray.splice(index, 1, ...defaultoptions);
18
15
  return newArray;
19
16
  }
20
-
21
17
  const isEqualVal = (a, b) => a === b;
22
-
23
18
  function getArrayWithDefault(array, defaultoptions = [], isEqual = isEqualVal) {
24
19
  const index = array.indexOf('...');
25
-
26
20
  if (index === -1) {
27
21
  return array;
28
22
  }
29
-
30
23
  const filteredDefaultOptions = defaultoptions.filter(v => !array.some(v1 => isEqual(v, v1)));
31
24
  const newArray = [...array];
32
25
  newArray.splice(index, 1, ...filteredDefaultOptions);
@@ -4,24 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = webpackBuild;
7
-
8
7
  var _webpack = require("webpack");
9
-
10
8
  var _statsConfig = require("./statsConfig");
11
-
12
9
  var _webpackConfig = _interopRequireDefault(require("./webpackConfig"));
13
-
14
10
  var _logger = require("../../../logger");
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
12
  function webpackBuild(options) {
19
13
  const config = (0, _webpackConfig.default)(options);
20
14
  (0, _webpack.webpack)(config, (err, stats) => {
21
15
  if (err || stats.hasErrors()) {
22
16
  (0, _logger.errorLogger)('err', err);
23
17
  }
24
-
25
18
  (0, _logger.messageLogger)(stats.toString((0, _statsConfig.statsConfig)(options)));
26
19
  });
27
20
  }
@@ -4,39 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = webpackConfigCreator;
7
-
8
7
  var _entryConfig = require("./entryConfig");
9
-
10
8
  var _outputConfig = require("./outputConfig");
11
-
12
9
  var _jsLoaders = require("./jsLoaders");
13
-
14
10
  var _tsLoaders = require("./tsLoaders");
15
-
16
11
  var _cssLoaders = require("./cssLoaders");
17
-
18
12
  var _assetLoaders = require("./loaderConfigs/assetLoaders");
19
-
20
13
  var _plugins = require("./plugins");
21
-
22
14
  var _resolvers = require("./resolvers");
23
-
24
15
  var _optimizationConfig = require("./optimizationConfig");
25
-
26
16
  var _configHtmlTemplateLoader = require("./loaderConfigs/configHtmlTemplateLoader");
27
-
28
17
  var _configWebWorkerLoader = require("./loaderConfigs/configWebWorkerLoader");
29
-
30
18
  var _statsConfig = require("./statsConfig");
31
-
32
19
  var _devtoolConfig = require("./devtoolConfig");
33
-
34
20
  var _modeUtils = require("./common/modeUtils");
35
-
36
21
  var _externals = require("./externals");
37
-
38
22
  var _configCustomLoaders = require("./configCustomLoaders");
39
-
40
23
  function webpackConfigCreator(options) {
41
24
  return {
42
25
  entry: (0, _entryConfig.entryConfig)(options),