@zohodesk/client_build_tool 0.0.11-exp.16.0 → 0.0.11-exp.17.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 (220) hide show
  1. package/README.md +102 -0
  2. package/README_backup.md +102 -0
  3. package/lib/allCommandsConfigs.js +7 -2
  4. package/lib/commands/build/commandExecutor.js +5 -1
  5. package/lib/commands/build/config.js +3 -2
  6. package/lib/commands/build/optionsProcessor.js +5 -2
  7. package/lib/commands/build/preProcessor.js +2 -0
  8. package/lib/commands/buildEs/commandExecutor.js +5 -0
  9. package/lib/commands/buildEs/config.js +3 -2
  10. package/lib/commands/buildEs/preProcessor.js +2 -0
  11. package/lib/commands/buildLib/commandExecutor.js +5 -0
  12. package/lib/commands/buildLib/config.js +3 -2
  13. package/lib/commands/buildLib/preProcessor.js +2 -0
  14. package/lib/commands/mockserver/commandExecutor.js +9 -2
  15. package/lib/commands/mockserver/config.js +3 -2
  16. package/lib/commands/pre_process/commandExecutor.js +2 -0
  17. package/lib/commands/pre_process/config.js +3 -2
  18. package/lib/commands/start/commandExecutor.js +2 -0
  19. package/lib/commands/start/config.js +3 -2
  20. package/lib/commands/start/optionsProcessor.js +4 -2
  21. package/lib/commands/start/preProcessor.js +2 -0
  22. package/lib/commands/template/commandExecutor.js +7 -0
  23. package/lib/commands/template/config.js +3 -2
  24. package/lib/commands/version/commandExecutor.js +3 -0
  25. package/lib/commands/version/config.js +3 -2
  26. package/lib/commandsRouter.js +21 -5
  27. package/lib/index.js +2 -0
  28. package/lib/logger.js +5 -0
  29. package/lib/schemas/applyValuesToSchema/index.js +8 -0
  30. package/lib/schemas/applyValuesToSchema/isObject.js +1 -0
  31. package/lib/schemas/applyValuesToSchema/isValid.js +2 -0
  32. package/lib/schemas/cliArgsToObject.js +6 -2
  33. package/lib/schemas/defaultConfigValues.js +17 -4
  34. package/lib/schemas/defaultConfigValuesOnly.js +33 -4
  35. package/lib/schemas/deprecatedOptionsHandler.js +16 -7
  36. package/lib/schemas/getNpmVersion.js +5 -0
  37. package/lib/schemas/giveDefaultValue.js +3 -0
  38. package/lib/schemas/npmConfigToObject.js +5 -2
  39. package/lib/schemas/readOptions.js +30 -10
  40. package/lib/schemas/readOptionsForConfigFile.js +12 -2
  41. package/lib/shared/babel/addDefaultPlugins.js +2 -0
  42. package/lib/shared/babel/babelWebConfig.js +10 -1
  43. package/lib/shared/babel/babel_plugins/removeAttributesPlugin.js +4 -0
  44. package/lib/shared/babel/getBabelPlugin.js +7 -2
  45. package/lib/shared/babel/runBabelForJSFile.js +4 -1
  46. package/lib/shared/babel/runBabelForTsFile.js +5 -1
  47. package/lib/shared/bundler/webpack/common/decidePublicPath.js +5 -0
  48. package/lib/shared/bundler/webpack/common/libAlias.js +3 -3
  49. package/lib/shared/bundler/webpack/common/modeUtils.js +5 -0
  50. package/lib/shared/bundler/webpack/common/nameTemplates.js +18 -11
  51. package/lib/shared/bundler/webpack/common/resourceBasedPublicPath.js +3 -2
  52. package/lib/shared/bundler/webpack/configCustomLoaders.js +1 -0
  53. package/lib/shared/bundler/webpack/cssLoaders.js +2 -0
  54. package/lib/shared/bundler/webpack/custom_plugins/BundleIntegrityReport/index.js +20 -1
  55. package/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin/index.js +25 -20
  56. package/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin/webpackCustomJsUrlLoader.js +9 -4
  57. package/lib/shared/bundler/webpack/custom_plugins/CustomScriptLoadingPlugin.js +23 -3
  58. package/lib/shared/bundler/webpack/custom_plugins/EFCTemplatePlugin.js +19 -8
  59. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nGroupRuntimeModule.js +61 -37
  60. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexHtmlInjectorPlugin.js +33 -15
  61. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexPlugin.js +108 -60
  62. package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/utils/i18nDataLoader.js +26 -20
  63. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nFilesEmitPlugin.js +26 -5
  64. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +16 -13
  65. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nRuntimeDealerPlugin.js +53 -19
  66. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/LocaleChunkAssetsStore.js +17 -2
  67. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ModulesI18nKeysStore.js +13 -0
  68. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +21 -11
  69. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +4 -0
  70. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +14 -4
  71. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +13 -3
  72. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/iterateModulesInChunk.js +12 -3
  73. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +7 -2
  74. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +2 -0
  75. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +3 -2
  76. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +4 -2
  77. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +13 -8
  78. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +14 -2
  79. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/getChunkModules.js +1 -0
  80. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +3 -1
  81. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +4 -0
  82. package/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +25 -5
  83. package/lib/shared/bundler/webpack/custom_plugins/InitialHtmlPlugin.js +10 -3
  84. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/addFilesNamesToManifestJson.js +6 -1
  85. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createInitialEntries.js +6 -1
  86. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/createManifestJson.js +6 -0
  87. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/findInitialFileNames.js +1 -0
  88. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/index.js +7 -0
  89. package/lib/shared/bundler/webpack/custom_plugins/ManifestJsonPlugin/removeHashFromFileName.js +1 -0
  90. package/lib/shared/bundler/webpack/custom_plugins/ResourceHintsPlugin.js +17 -13
  91. package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +15 -6
  92. package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +13 -4
  93. package/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +6 -4
  94. package/lib/shared/bundler/webpack/custom_plugins/RuntimeResourceCleanup/index.js +10 -0
  95. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/classHandling.js +3 -0
  96. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/index.js +20 -4
  97. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/selectorWeightPrefixAdder.js +12 -10
  98. package/lib/shared/bundler/webpack/custom_plugins/SelectorWeightPlugin/windowsModification.js +3 -2
  99. package/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +20 -7
  100. package/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPluginUtils.js +1 -0
  101. package/lib/shared/bundler/webpack/custom_plugins/SourceMapPlugin/index.js +10 -7
  102. package/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/addHashToFilePath.js +6 -1
  103. package/lib/shared/bundler/webpack/custom_plugins/TPHashMappingPlugin/index.js +16 -1
  104. package/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin/index.js.js +11 -4
  105. package/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/ErrorHandler.js +10 -3
  106. package/lib/shared/bundler/webpack/custom_plugins/VariableConversionCollector/index.js +62 -27
  107. package/lib/shared/bundler/webpack/custom_plugins/custom_attribute_plugin/index.js +15 -3
  108. package/lib/shared/bundler/webpack/custom_plugins/emitAsset.js +1 -0
  109. package/lib/shared/bundler/webpack/custom_plugins/getInitialAssetsFuncTemplate.js +12 -2
  110. package/lib/shared/bundler/webpack/custom_plugins/getInitialI18nAssetsArrayStr.js +7 -2
  111. package/lib/shared/bundler/webpack/defaultVendorPatternList.js +6 -2
  112. package/lib/shared/bundler/webpack/devtoolConfig.js +1 -0
  113. package/lib/shared/bundler/webpack/entryConfig.js +4 -0
  114. package/lib/shared/bundler/webpack/externals.js +1 -0
  115. package/lib/shared/bundler/webpack/getCSSLoaders.js +6 -1
  116. package/lib/shared/bundler/webpack/getFilenameFromModule.js +5 -1
  117. package/lib/shared/bundler/webpack/jsLoaders.js +10 -6
  118. package/lib/shared/bundler/webpack/loaderConfigs/assetLoaders.js +2 -0
  119. package/lib/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +3 -2
  120. package/lib/shared/bundler/webpack/loaderConfigs/checkIsPatternsMatchFilename.js +12 -3
  121. package/lib/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +1 -0
  122. package/lib/shared/bundler/webpack/loaderConfigs/configPostCssLoader.js +10 -2
  123. package/lib/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +2 -0
  124. package/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +12 -0
  125. package/lib/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +15 -1
  126. package/lib/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +4 -1
  127. package/lib/shared/bundler/webpack/loaderConfigs/i18nIdReplaceLoaderConfig.js +16 -8
  128. package/lib/shared/bundler/webpack/loaders/i18nIdReplaceLoader.js +29 -22
  129. package/lib/shared/bundler/webpack/loaders/miniCssFallBackLoader.js +2 -2
  130. package/lib/shared/bundler/webpack/loaders/workerLoader.js +19 -8
  131. package/lib/shared/bundler/webpack/optimizationConfig.js +13 -5
  132. package/lib/shared/bundler/webpack/outputConfig.js +9 -1
  133. package/lib/shared/bundler/webpack/pluginConfigs/configBundleAnalyzer.js +9 -5
  134. package/lib/shared/bundler/webpack/pluginConfigs/configBundleIntegrityReport.js +5 -0
  135. package/lib/shared/bundler/webpack/pluginConfigs/configCSSMinifierPlugin.js +9 -4
  136. package/lib/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +8 -3
  137. package/lib/shared/bundler/webpack/pluginConfigs/configCopyPublicFolders.js +16 -1
  138. package/lib/shared/bundler/webpack/pluginConfigs/configCustomAttributesPlugin.js +4 -0
  139. package/lib/shared/bundler/webpack/pluginConfigs/configCustomScriptLoadingStrategyPlugin.js +16 -0
  140. package/lib/shared/bundler/webpack/pluginConfigs/configEFCTemplatePlugin.js +5 -0
  141. package/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +5 -0
  142. package/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +8 -2
  143. package/lib/shared/bundler/webpack/pluginConfigs/configI18nIndexingPlugin.js +9 -5
  144. package/lib/shared/bundler/webpack/pluginConfigs/configI18nNumericHtmlInjector.js +25 -19
  145. package/lib/shared/bundler/webpack/pluginConfigs/configI18nNumericIndexPlugin.js +26 -12
  146. package/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +9 -3
  147. package/lib/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +2 -0
  148. package/lib/shared/bundler/webpack/pluginConfigs/configManifestJsonPlugin.js +7 -0
  149. package/lib/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +7 -3
  150. package/lib/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +5 -1
  151. package/lib/shared/bundler/webpack/pluginConfigs/configResourceHintsPlugin.js +4 -1
  152. package/lib/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +4 -0
  153. package/lib/shared/bundler/webpack/pluginConfigs/configRuntimeResourceCleanup.js +8 -3
  154. package/lib/shared/bundler/webpack/pluginConfigs/configSelectorWeightPlugin.js +6 -1
  155. package/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +8 -3
  156. package/lib/shared/bundler/webpack/pluginConfigs/configSourceMapPlugin.js +4 -0
  157. package/lib/shared/bundler/webpack/pluginConfigs/configTPHashMappingPlugin.js +8 -1
  158. package/lib/shared/bundler/webpack/pluginConfigs/configVariableConversionPlugin.js +6 -1
  159. package/lib/shared/bundler/webpack/plugins.js +24 -1
  160. package/lib/shared/bundler/webpack/resolvers.js +17 -3
  161. package/lib/shared/bundler/webpack/splitChunksConfig.js +15 -2
  162. package/lib/shared/bundler/webpack/statsConfig.js +5 -2
  163. package/lib/shared/bundler/webpack/tsLoaders.js +4 -2
  164. package/lib/shared/bundler/webpack/utils/index.js +12 -1
  165. package/lib/shared/bundler/webpack/utils/object-manipulation.js +16 -2
  166. package/lib/shared/bundler/webpack/utils/updateArrayWithDefault.js +7 -0
  167. package/lib/shared/bundler/webpack/webpackBuild.js +8 -1
  168. package/lib/shared/bundler/webpack/webpackConfig.js +17 -0
  169. package/lib/shared/commands-utils/doBasicRequirementCheck.js +3 -0
  170. package/lib/shared/commands-utils/getCliPath.js +9 -5
  171. package/lib/shared/commands-utils/index.js +3 -0
  172. package/lib/shared/commands-utils/log.js +2 -0
  173. package/lib/shared/commands-utils/readArgsFormCommandLine.js +1 -0
  174. package/lib/shared/commands-utils/readOptionFormCommandLine.js +1 -0
  175. package/lib/shared/commands-utils/spawnSyncIO.js +13 -5
  176. package/lib/shared/constants.js +29 -9
  177. package/lib/shared/fileUtils/copyFile.js +8 -1
  178. package/lib/shared/fileUtils/directoryIterator.js +4 -0
  179. package/lib/shared/fileUtils/watchRun.js +24 -3
  180. package/lib/shared/postcss/custom_postcss_plugins/EmptyPlugin.js +6 -1
  181. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/constants.js +3 -2
  182. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/handleIgnores.js +13 -6
  183. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/index.js +26 -6
  184. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/insertBefore.js +9 -6
  185. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/isPreviouslyProcessed.js +3 -0
  186. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/replaceUtils.js +7 -2
  187. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/separateHoveredSelectorAndNormalSelector.js +2 -0
  188. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/specialCases.js +9 -4
  189. package/lib/shared/postcss/custom_postcss_plugins/HoverActivePlugin/typeCheckUtils.js +10 -0
  190. package/lib/shared/postcss/custom_postcss_plugins/RTLSplitPlugin.js +29 -16
  191. package/lib/shared/postcss/custom_postcss_plugins/SelectorReplace.js +17 -0
  192. package/lib/shared/postcss/custom_postcss_plugins/ValueReplacer.js +9 -4
  193. package/lib/shared/postcss/custom_postcss_plugins/VariableModificationPlugin/index.js +63 -27
  194. package/lib/shared/postcss/filterPluginsAllowedForSpecficFile.js +13 -5
  195. package/lib/shared/postcss/getAllowedPostCssPlugins.js +3 -0
  196. package/lib/shared/postcss/getSpecificPostCssPlugin.js +17 -7
  197. package/lib/shared/postcss/runPostCssForCssFile.js +9 -1
  198. package/lib/shared/pre_process/runPreProcess.js +11 -0
  199. package/lib/shared/server/configWebpackDevMiddleware.js +8 -1
  200. package/lib/shared/server/corsHandling.js +6 -2
  201. package/lib/shared/server/getIp.js +7 -1
  202. package/lib/shared/server/getServerURL.js +6 -0
  203. package/lib/shared/server/httpsOptions.js +11 -0
  204. package/lib/shared/server/initExpressApp.js +4 -1
  205. package/lib/shared/server/initialHTMLHandling.js +16 -7
  206. package/lib/shared/server/mockApiHandler.js +16 -8
  207. package/lib/shared/server/mockServer.js +7 -0
  208. package/lib/shared/server/serveContextFiles.js +5 -1
  209. package/lib/shared/server/serverBywebpackDevMiddleware.js +9 -4
  210. package/lib/shared/server/startHttpServer.js +3 -0
  211. package/lib/shared/server/startHttpsServer.js +9 -1
  212. package/lib/shared/server/unwanted/addHttp2Server.js +7 -2
  213. package/lib/shared/server/unwanted/configWebpackDevMiddleware.js +8 -1
  214. package/lib/shared/server/unwanted/mockApiSupport.js +2 -0
  215. package/lib/shared/server/unwanted/websocketMockSetup.js +7 -1
  216. package/lib/shared/server/urlConcat.js +8 -3
  217. package/lib/shared/utils/requireLocalOrGlobal.js +25 -10
  218. package/lib/shared/utils/versionPrint.js +6 -1
  219. package/npm-shrinkwrap.json +2 -2
  220. package/package.json +1 -1
@@ -5,7 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getAllowedPostCssPlugins = getAllowedPostCssPlugins;
7
7
  exports.postcssPluginGetter = postcssPluginGetter;
8
+
8
9
  var _filterPluginsAllowedForSpecficFile = require("./filterPluginsAllowedForSpecficFile");
10
+
9
11
  function getAllowedPostCssPlugins(filename, enabledPlugins, enabledCustomPlugins) {
10
12
  const neededPostCssPlugins = (0, _filterPluginsAllowedForSpecficFile.filterPluginsAllowedForSpecificFile)(enabledPlugins, filename);
11
13
  const neededCustomPlugins = (0, _filterPluginsAllowedForSpecficFile.filterCustomPluginsAllowedForSpecificFile)(enabledCustomPlugins, filename);
@@ -13,6 +15,7 @@ function getAllowedPostCssPlugins(filename, enabledPlugins, enabledCustomPlugins
13
15
  plugins: [...neededPostCssPlugins, ...neededCustomPlugins]
14
16
  };
15
17
  }
18
+
16
19
  function postcssPluginGetter(options) {
17
20
  const pluginsOptions = options.css.plugins;
18
21
  const {
@@ -6,33 +6,42 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.configPostCssRtl = configPostCssRtl;
7
7
  exports.getSpecificPostCssPlugin = getSpecificPostCssPlugin;
8
8
  exports.supportedPluginsOptionNames = void 0;
9
+
9
10
  var _fs = require("fs");
11
+
10
12
  var _postcssRtl = _interopRequireDefault(require("postcss-rtl"));
13
+
11
14
  var _SelectorReplace = _interopRequireDefault(require("./custom_postcss_plugins/SelectorReplace"));
15
+
12
16
  var _ValueReplacer = _interopRequireDefault(require("./custom_postcss_plugins/ValueReplacer"));
17
+
13
18
  var _HoverActivePlugin = _interopRequireDefault(require("./custom_postcss_plugins/HoverActivePlugin"));
19
+
14
20
  var _VariableModificationPlugin = _interopRequireDefault(require("./custom_postcss_plugins/VariableModificationPlugin"));
15
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
- /* eslint-disable no-use-before-define */
17
21
 
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
+
24
+ /* eslint-disable no-use-before-define */
18
25
  function getSpecificPostCssPlugin(pluginOption) {
19
26
  return postcssPluginMapper[pluginOption.pluginName]?.(pluginOption);
20
- }
27
+ } // eslint-disable-next-line no-unused-vars
28
+
21
29
 
22
- // eslint-disable-next-line no-unused-vars
23
30
  function configPostCssRtl(pluginOption) {
24
31
  return (0, _postcssRtl.default)({
25
32
  addPrefixToSelector: function addPrefixToSelector(selector, prefix) {
26
33
  if (prefix === '[dir]') {
27
34
  return selector;
28
35
  }
36
+
29
37
  return `${prefix} ${selector}`; // Make selectors like [dir=rtl] > .selector
30
38
  }
31
39
  });
32
- }
40
+ } // NOTE: we have keeping array because we need to maintain order (Just In Cases For Future)
41
+
33
42
 
34
- // NOTE: we have keeping array because we need to maintain order (Just In Cases For Future)
35
- const supportedPluginsOptionNames = exports.supportedPluginsOptionNames = ['rtl', 'valueReplacer', 'selectorReplace', 'hoverActive', 'cssVariableReplacement'];
43
+ const supportedPluginsOptionNames = ['rtl', 'valueReplacer', 'selectorReplace', 'hoverActive', 'cssVariableReplacement'];
44
+ exports.supportedPluginsOptionNames = supportedPluginsOptionNames;
36
45
  const postcssPluginMapper = {
37
46
  rtl: configPostCssRtl,
38
47
  selectorReplace: pluginOption => (0, _SelectorReplace.default)(pluginOption),
@@ -40,6 +49,7 @@ const postcssPluginMapper = {
40
49
  hoverActive: pluginOption => (0, _HoverActivePlugin.default)(pluginOption),
41
50
  cssVariableReplacement: configCssVariableReplacement
42
51
  };
52
+
43
53
  function configCssVariableReplacement(pluginOption) {
44
54
  const {
45
55
  configFile
@@ -4,11 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.runPostCssForCssFile = runPostCssForCssFile;
7
+
7
8
  var _postcss = _interopRequireDefault(require("postcss"));
9
+
8
10
  var _fs = require("fs");
11
+
9
12
  var _getAllowedPostCssPlugins = require("./getAllowedPostCssPlugins");
13
+
10
14
  var _copyFile = require("../fileUtils/copyFile");
11
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
12
18
  function runPostCssForCssFile({
13
19
  filename,
14
20
  outputFile,
@@ -16,9 +22,11 @@ function runPostCssForCssFile({
16
22
  }) {
17
23
  const getAllowedPostCssPlugins = (0, _getAllowedPostCssPlugins.postcssPluginGetter)(options);
18
24
  const allowedPostCssPlugins = getAllowedPostCssPlugins(filename);
25
+
19
26
  if (allowedPostCssPlugins.length === 0) {
20
27
  return;
21
28
  }
29
+
22
30
  const css = (0, _fs.readFileSync)(filename).toString();
23
31
  (0, _postcss.default)(allowedPostCssPlugins).process(css, {
24
32
  from: filename,
@@ -4,11 +4,17 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.runPreProcess = runPreProcess;
7
+
7
8
  var _path = require("path");
9
+
8
10
  var _fs = require("fs");
11
+
9
12
  var _spawnSyncIO = require("../commands-utils/spawnSyncIO");
13
+
10
14
  var _logger = require("../../logger");
15
+
11
16
  var _constants = require("../constants");
17
+
12
18
  function runPreProcess(options, runnerCli = 'node') {
13
19
  const {
14
20
  preProcess
@@ -18,15 +24,19 @@ function runPreProcess(options, runnerCli = 'node') {
18
24
  runner,
19
25
  stopNodemon
20
26
  } = preProcess;
27
+
21
28
  if (!enable || !runner) {
22
29
  return null;
23
30
  }
31
+
24
32
  const preprocessorPath = (0, _constants.joinWithAppPath)(runner);
25
33
  let result = null;
34
+
26
35
  if ((0, _fs.existsSync)(preprocessorPath)) {
27
36
  const preprocessorDirPath = (0, _path.dirname)(preprocessorPath);
28
37
  const watchOptions = ['--watch', preprocessorDirPath];
29
38
  const preprocessCli = stopNodemon ? 'node' : runnerCli;
39
+
30
40
  if (preprocessCli === 'node') {
31
41
  result = (0, _spawnSyncIO.spawnSyncIO)(preprocessCli, [preprocessorPath], {
32
42
  stdio: 'inherit',
@@ -43,5 +53,6 @@ function runPreProcess(options, runnerCli = 'node') {
43
53
  (0, _logger.errorLogger)(`preProcessor not exists ${preprocessorPath}`);
44
54
  process.exit(0);
45
55
  }
56
+
46
57
  return result;
47
58
  }
@@ -5,11 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.configWebpackDevMiddleware = configWebpackDevMiddleware;
7
7
  exports.webpackDevMiddlewareConfig = webpackDevMiddlewareConfig;
8
+
8
9
  var _webpack = require("webpack");
10
+
9
11
  var _webpackDevMiddleware = _interopRequireDefault(require("webpack-dev-middleware"));
12
+
10
13
  var _statsConfig = require("../bundler/webpack/statsConfig");
14
+
11
15
  var _webpackConfig = _interopRequireDefault(require("../bundler/webpack/webpackConfig"));
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
+
17
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+
13
19
  function webpackDevMiddlewareConfig(options) {
14
20
  const {
15
21
  publicPath
@@ -23,6 +29,7 @@ function webpackDevMiddlewareConfig(options) {
23
29
  }
24
30
  };
25
31
  }
32
+
26
33
  function configWebpackDevMiddleware(app, options) {
27
34
  const config = (0, _webpackConfig.default)(options);
28
35
  const compiler = (0, _webpack.webpack)(config);
@@ -4,20 +4,24 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.corsHandling = corsHandling;
7
+
7
8
  // eslint-disable-next-line no-unused-vars
8
9
  function corsHandling(app, options) {
9
10
  app.use((req, res, next) => {
10
11
  // console.log('origin', req.get('origin'));
11
- res.setHeader('Access-Control-Allow-Origin', req.get('origin') || '*');
12
- // res.setHeader('Access-Control-Allow-Origin', req.get('origin'));
12
+ res.setHeader('Access-Control-Allow-Origin', req.get('origin') || '*'); // res.setHeader('Access-Control-Allow-Origin', req.get('origin'));
13
+
13
14
  res.setHeader('Access-Control-Allow-Private-Network', true);
14
15
  res.setHeader('Access-Control-Allow-Credentials', true);
16
+
15
17
  if (req.get('Access-Control-Request-Headers')) {
16
18
  res.setHeader('Access-Control-Allow-Headers', req.get('Access-Control-Request-Headers'));
17
19
  }
20
+
18
21
  if (req.get('Access-Control-Request-Method')) {
19
22
  res.setHeader('Access-Control-Allow-Methods', req.get('Access-Control-Request-Method'));
20
23
  }
24
+
21
25
  next();
22
26
  });
23
27
  app.options('/*', (req, res) => {
@@ -4,16 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getIp = getIp;
7
+
7
8
  var _os = _interopRequireDefault(require("os"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
9
12
  function getIp() {
10
13
  const ifaces = _os.default.networkInterfaces();
14
+
11
15
  let ips = [];
12
16
  Object.keys(ifaces).forEach(ifname => {
13
17
  const a = ifaces[ifname].map(iface => {
14
18
  if (iface.family !== 'IPv4' || iface.internal !== false) {
15
19
  return null;
16
20
  }
21
+
17
22
  return iface.address;
18
23
  }).filter(a => a);
19
24
  ips = ips.concat(a);
@@ -21,4 +26,5 @@ function getIp() {
21
26
  ips.push('127.0.0.1');
22
27
  return ips[0];
23
28
  }
29
+
24
30
  ;
@@ -5,17 +5,21 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.getServerDomain = getServerDomain;
7
7
  exports.getServerUrl = getServerUrl;
8
+
8
9
  function getServerDomain(serverInfo) {
9
10
  const {
10
11
  host,
11
12
  domain,
12
13
  k8s
13
14
  } = serverInfo;
15
+
14
16
  if (domain && !k8s) {
15
17
  return `${host}.${domain}.zohocorpin.com`;
16
18
  }
19
+
17
20
  return host;
18
21
  }
22
+
19
23
  function getServerUrl({
20
24
  domain,
21
25
  k8s,
@@ -23,8 +27,10 @@ function getServerUrl({
23
27
  protocol = 'http'
24
28
  }) {
25
29
  const prefix = protocol ? `${protocol}:` : '';
30
+
26
31
  if (k8s) {
27
32
  return `${prefix}//${domain}`;
28
33
  }
34
+
29
35
  return `${prefix}//${domain}:${port}/`;
30
36
  }
@@ -4,32 +4,43 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.httpsOptionsWithUserFriendlyError = httpsOptionsWithUserFriendlyError;
7
+
7
8
  var _logger = require("../../logger");
9
+
8
10
  var _requireLocalOrGlobal = require("../utils/requireLocalOrGlobal");
11
+
9
12
  const defaultCertNpm = '@zohodesk-private/client_dev_cert';
13
+
10
14
  function httpsOptionsWithUserFriendlyError(options) {
11
15
  const {
12
16
  httpsCerts
13
17
  } = options.server;
18
+
14
19
  if (typeof httpsCerts === 'string' && httpsCerts) {
15
20
  const certificate = (0, _requireLocalOrGlobal.requireAllPossible)(httpsCerts);
21
+
16
22
  if (certificate.local) {
17
23
  (0, _logger.verboseLogger)(`Local '${httpsCerts}' package taken as HTTPS certificate`);
18
24
  return certificate.local.httpsOptions;
19
25
  }
26
+
20
27
  if (certificate.global) {
21
28
  (0, _logger.messageLogger)(`Global '${httpsCerts}' package taken as HTTPS certificate`);
22
29
  return certificate.global.httpsOptions;
23
30
  }
31
+
24
32
  (0, _logger.errorLogger)(`
25
33
  You have given 'server.httpsCerts' as "${httpsCerts}".
26
34
  But it seems that file path have some problem;`);
27
35
  process.exit(0);
28
36
  }
37
+
29
38
  const globalCertificate = (0, _requireLocalOrGlobal.requireGlobal)(defaultCertNpm);
39
+
30
40
  if (globalCertificate) {
31
41
  (0, _logger.messageLogger)(`Global '${defaultCertNpm}' package taken as HTTPS certificate`);
32
42
  return globalCertificate.httpsOptions;
33
43
  }
44
+
34
45
  return null;
35
46
  }
@@ -4,8 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.initExpressApp = initExpressApp;
7
+
7
8
  var _express = _interopRequireDefault(require("express"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
9
12
  function initExpressApp() {
10
13
  const app = (0, _express.default)();
11
14
  app.use(_express.default.json());
@@ -4,9 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.initialHTMLHandling = initialHTMLHandling;
7
+
7
8
  var _logger = require("../../logger");
8
- /* eslint-disable no-use-before-define */
9
9
 
10
+ /* eslint-disable no-use-before-define */
10
11
  function initialHTMLHandling(compiler, app, options) {
11
12
  const {
12
13
  enableMockReplace
@@ -24,9 +25,8 @@ function initialHTMLHandling(compiler, app, options) {
24
25
  } = options.serverExtras;
25
26
  let initialHTML;
26
27
  compiler.hooks.afterCompile.tap('ReactCLI', compilation => {
27
- const indexHtml = compilation.assets['index.html'];
28
+ const indexHtml = compilation.assets['index.html']; // compiler.outputFileSystem.readFileSync("build/index.html");
28
29
 
29
- // compiler.outputFileSystem.readFileSync("build/index.html");
30
30
  if (indexHtml) {
31
31
  initialHTML = indexHtml.source();
32
32
  }
@@ -43,44 +43,53 @@ function initialHTMLHandling(compiler, app, options) {
43
43
  });
44
44
  res.send(newHTML);
45
45
  });
46
+
46
47
  function modifyInitialHTML({
47
48
  initialHTML,
48
49
  enableMockReplace,
49
50
  req
50
51
  }) {
51
52
  let newHTML = enableMockReplace && initialHTML ? mockReplace(initialHTML, req.query) : initialHTML;
53
+
52
54
  if (req.protocol === 'http') {
53
55
  newHTML = newHTML.replaceAll(httpsUrl, httpUrl);
54
56
  }
57
+
55
58
  return newHTML;
56
59
  }
60
+
57
61
  function mockReplace(inputHTML, query) {
58
62
  const {
59
63
  dir,
60
64
  locale
61
65
  } = query || {};
62
66
  let newHTML = inputHTML;
67
+
63
68
  if (i18nChunkSplit.chunkSplitEnable) {
64
69
  newHTML = replaceWithRandomLocale(newHTML, i18nChunkSplit.templateLabel, locale);
65
70
  }
71
+
66
72
  if (rtlSplit.enableRTLSplit) {
67
73
  newHTML = replaceWithRandomDir(newHTML, rtlSplit.templateLabel, dir);
68
74
  }
75
+
69
76
  return newHTML;
70
77
  }
78
+
71
79
  function replaceWithRandomLocale(initialHTML, templateLabel, queryLocale) {
72
- const locales = ['ar_EG', 'da_DK', 'de_DE', 'en_US', 'es_AR', 'es_ES', 'fr_FR', 'hi_IN', 'in_ID', 'it_IT', 'iw_IL', 'ja_JP', 'nl_NL', 'pl_PL', 'pt_BR', 'pt_PT', 'ro_RO', 'ru_RU', 'sv_SE', 'ta_IN', 'te_IN', 'tr_TR', 'zh_CN', 'zh_TW'];
73
- // app.use(`/desk/*`, (req, res) => {
80
+ const locales = ['ar_EG', 'da_DK', 'de_DE', 'en_US', 'es_AR', 'es_ES', 'fr_FR', 'hi_IN', 'in_ID', 'it_IT', 'iw_IL', 'ja_JP', 'nl_NL', 'pl_PL', 'pt_BR', 'pt_PT', 'ro_RO', 'ru_RU', 'sv_SE', 'ta_IN', 'te_IN', 'tr_TR', 'zh_CN', 'zh_TW']; // app.use(`/desk/*`, (req, res) => {
74
81
  // const locale = 'ta_IN';
82
+
75
83
  const locale = queryLocale || locales[Math.floor(Math.random() * locales.length)];
76
84
  (0, _logger.verboseLogger)({
77
85
  locale
78
86
  });
79
87
  return initialHTML.replaceAll(templateLabel, locale);
80
88
  }
89
+
81
90
  function replaceWithRandomDir(initialHTML, templateLabel, queryDir) {
82
- const dirs = ['ltr', 'rtl'];
83
- // const dir = 'rtl';
91
+ const dirs = ['ltr', 'rtl']; // const dir = 'rtl';
92
+
84
93
  const dir = queryDir || dirs[Math.floor(Math.random() * dirs.length)];
85
94
  (0, _logger.verboseLogger)({
86
95
  dir
@@ -5,10 +5,15 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.handleMockApi = handleMockApi;
7
7
  exports.mockApiHandler = mockApiHandler;
8
+
8
9
  var _fs = require("fs");
10
+
9
11
  var _httpProxyMiddleware = require("http-proxy-middleware");
12
+
10
13
  var _constants = require("../constants");
14
+
11
15
  var _logger = require("../../logger");
16
+
12
17
  function mockApiHandler(app, options) {
13
18
  const {
14
19
  enable,
@@ -16,9 +21,11 @@ function mockApiHandler(app, options) {
16
21
  mockEntryFile,
17
22
  mockPrefix
18
23
  } = options.mockServer;
24
+
19
25
  if (!enable) {
20
26
  return;
21
27
  }
28
+
22
29
  if (separateSeverPort) {
23
30
  app.use(mockPrefix, (0, _httpProxyMiddleware.createProxyMiddleware)({
24
31
  // eslint-disable-next-line no-useless-concat
@@ -32,28 +39,29 @@ function mockApiHandler(app, options) {
32
39
  handleMockApi(mockEntryFile, app);
33
40
  }
34
41
  }
42
+
35
43
  function handleMockApi(mockEntryFile, app) {
36
- const entryFilePath = (0, _constants.joinWithAppPath)(mockEntryFile);
37
- // eslint-disable-next-line no-use-before-define
44
+ const entryFilePath = (0, _constants.joinWithAppPath)(mockEntryFile); // eslint-disable-next-line no-use-before-define
45
+
38
46
  const mockFunc = safeRequire(entryFilePath);
47
+
39
48
  if (typeof mockFunc === 'function') {
40
49
  // eslint-disable-next-line no-use-before-define
41
50
  mockFunc(app);
42
51
  return;
43
52
  }
44
- mockFunc?.mockApi?.(app);
45
- }
46
-
47
- // function handleMockApi(params) {
48
53
 
54
+ mockFunc?.mockApi?.(app);
55
+ } // function handleMockApi(params) {
49
56
  // }
50
57
 
58
+
51
59
  function safeRequire(entryFilePath) {
52
60
  if (!(0, _fs.existsSync)(entryFilePath)) {
53
61
  (0, _logger.errorLogger)(`${entryFilePath} file not exists for mockapi, Please check the file presence`);
54
62
  return null;
55
- }
63
+ } // eslint-disable-next-line import/no-dynamic-require, global-require
64
+
56
65
 
57
- // eslint-disable-next-line import/no-dynamic-require, global-require
58
66
  return require(entryFilePath);
59
67
  }
@@ -2,11 +2,17 @@
2
2
  "use strict";
3
3
 
4
4
  var _readOptions = require("../../schemas/readOptions");
5
+
5
6
  var _corsHandling = require("./corsHandling");
7
+
6
8
  var _getServerURL = require("./getServerURL");
9
+
7
10
  var _initExpressApp = require("./initExpressApp");
11
+
8
12
  var _mockApiHandler = require("./mockApiHandler");
13
+
9
14
  var _startHttpServer = require("./startHttpServer");
15
+
10
16
  function getMockServerExtras(options) {
11
17
  const {
12
18
  separateSeverPort
@@ -23,6 +29,7 @@ function getMockServerExtras(options) {
23
29
  isHttps: false
24
30
  };
25
31
  }
32
+
26
33
  const options = (0, _readOptions.getOptions)();
27
34
  const {
28
35
  mockEntryFile
@@ -4,8 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.serveContextFiles = serveContextFiles;
7
+
7
8
  var _express = _interopRequireDefault(require("express"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
9
12
  function serveContextFiles(app, options) {
10
13
  const {
11
14
  context,
@@ -15,6 +18,7 @@ function serveContextFiles(app, options) {
15
18
  contextURL
16
19
  } = options.serverExtras;
17
20
  app.use(`${contextURL}/fonts`, _express.default.static(`${context}/fonts`));
21
+
18
22
  if (contextURL) {
19
23
  app.use(contextURL, _express.default.static(contextFolderPath));
20
24
  } else {
@@ -4,26 +4,31 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.run = run;
7
+
7
8
  var _corsHandling = require("./corsHandling");
9
+
8
10
  var _initExpressApp = require("./initExpressApp");
11
+
9
12
  var _configWebpackDevMiddleware = require("./configWebpackDevMiddleware");
13
+
10
14
  var _startHttpsServer = require("./startHttpsServer");
15
+
11
16
  var _initialHTMLHandling = require("./initialHTMLHandling");
17
+
12
18
  var _startHttpServer = require("./startHttpServer");
19
+
13
20
  var _mockApiHandler = require("./mockApiHandler");
14
- // import { serveContextFiles } from './serveContextFiles';
15
21
 
22
+ // import { serveContextFiles } from './serveContextFiles';
16
23
  // import { startHttpServer } from './startHttpServer';
17
-
18
24
  function run(options) {
19
25
  const app = (0, _initExpressApp.initExpressApp)();
20
26
  (0, _corsHandling.corsHandling)(app, options);
21
27
  (0, _mockApiHandler.mockApiHandler)(app, options);
22
28
  const {
23
29
  compiler
24
- } = (0, _configWebpackDevMiddleware.configWebpackDevMiddleware)(app, options);
30
+ } = (0, _configWebpackDevMiddleware.configWebpackDevMiddleware)(app, options); // serveContextFiles(app, options);
25
31
 
26
- // serveContextFiles(app, options);
27
32
  (0, _startHttpsServer.startHttpsServer)(app, options);
28
33
  (0, _startHttpServer.startHttpServer)(app, options);
29
34
  (0, _initialHTMLHandling.initialHTMLHandling)(compiler, app, options);
@@ -4,7 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.startHttpServer = startHttpServer;
7
+
7
8
  var _logger = require("../../logger");
9
+
8
10
  function startHttpServer(app, options) {
9
11
  const {
10
12
  serverExtras
@@ -17,6 +19,7 @@ function startHttpServer(app, options) {
17
19
  if (err) {
18
20
  throw err;
19
21
  }
22
+
20
23
  (0, _logger.messageLogger)(`Listening at ${httpUrl}`);
21
24
  });
22
25
  return app;
@@ -4,9 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.startHttpsServer = startHttpsServer;
7
+
7
8
  var _https = _interopRequireDefault(require("https"));
9
+
8
10
  var _logger = require("../../logger");
9
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
10
14
  function startHttpsServer(app, options) {
11
15
  const {
12
16
  httpsOptions,
@@ -16,14 +20,18 @@ function startHttpsServer(app, options) {
16
20
  httpsPort,
17
21
  httpsUrl
18
22
  } = serverExtras;
23
+
19
24
  if (!httpsOptions) {
20
25
  return null;
21
26
  }
27
+
22
28
  const httpsServer = _https.default.createServer(httpsOptions, app);
29
+
23
30
  httpsServer.listen(httpsPort, err => {
24
31
  if (err) {
25
32
  throw err;
26
33
  }
34
+
27
35
  (0, _logger.messageLogger)(`Listening at ${httpsUrl}`);
28
36
  });
29
37
  return httpsServer;
@@ -4,15 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.addHttp2Server = addHttp2Server;
7
+
7
8
  var _utils = require("../../../src/utils");
9
+
8
10
  var _httpsOptions = require("../../../src/servers/httpsOptions");
11
+
9
12
  function addHttp2Server(http2Port, host, domain, contextURL) {
10
13
  const isCompatableHttp2 = Number(process.version.slice(1).split('.')[0]) >= 8;
14
+
11
15
  if (isCompatableHttp2) {
12
16
  const http2 = require('http2');
13
- const http2Server = http2.createSecureServer(_httpsOptions.httpsOptions);
14
17
 
15
- // eslint-disable-next-line no-unused-vars
18
+ const http2Server = http2.createSecureServer(_httpsOptions.httpsOptions); // eslint-disable-next-line no-unused-vars
19
+
16
20
  http2Server.on('stream', (stream, headers) => {
17
21
  stream.respond({
18
22
  'content-type': 'text/html',
@@ -24,6 +28,7 @@ function addHttp2Server(http2Port, host, domain, contextURL) {
24
28
  if (err) {
25
29
  throw err;
26
30
  }
31
+
27
32
  (0, _utils.log)(`Listening at ${(0, _utils.getServerURL)({
28
33
  host,
29
34
  domain,
@@ -4,8 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configWebpackDevMiddleware = configWebpackDevMiddleware;
7
+
7
8
  var _webpackDevMiddleware = _interopRequireDefault(require("webpack-dev-middleware"));
8
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
9
12
  function configWebpackDevMiddleware({
10
13
  publicPath,
11
14
  writeToDisk,
@@ -22,16 +25,20 @@ function configWebpackDevMiddleware({
22
25
  },
23
26
  compress
24
27
  };
28
+
25
29
  if (enableDevCache) {
26
30
  webpackServerOptions.headers['Cache-Control'] = 'public, max-age=604800';
27
31
  }
32
+
28
33
  if (disableWatch) {
29
34
  webpackServerOptions.watchOptions = {
30
35
  ignored: /./
31
36
  };
32
37
  }
38
+
33
39
  if (writeToDisk) {
34
40
  webpackServerOptions.writeToDisk = true;
35
41
  }
42
+
36
43
  return (0, _webpackDevMiddleware.default)(compiler, webpackServerOptions);
37
44
  }