@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,18 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configBundleIntegrityReport = configBundleIntegrityReport;
7
-
8
7
  var _modeUtils = require("../common/modeUtils");
9
-
10
8
  var _BundleIntegrityReport = require("../custom_plugins/BundleIntegrityReport");
11
-
12
9
  function configBundleIntegrityReport(options) {
13
10
  const webpackMode = (0, _modeUtils.getWebpackMode)(options);
14
11
  const isProduction = (0, _modeUtils.isProductionMode)(webpackMode);
15
12
  const {
16
13
  enable: statsEnable
17
14
  } = options.stats;
18
-
19
15
  if (isProduction && statsEnable) {
20
16
  return new _BundleIntegrityReport.BundleIntegrityReport({
21
17
  fileName: options.stats.fileName || 'bundle-report-integrity.json',
@@ -31,6 +27,5 @@ function configBundleIntegrityReport(options) {
31
27
  }
32
28
  });
33
29
  }
34
-
35
30
  return null;
36
31
  }
@@ -4,24 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configCSSMinifierPlugin = configCSSMinifierPlugin;
7
-
8
7
  var _cssMinimizerWebpackPlugin = _interopRequireDefault(require("css-minimizer-webpack-plugin"));
9
-
10
8
  var _modeUtils = require("../common/modeUtils");
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
  // import UglifyCSSPlugin from '../custom_plugins/UglifyCSSPlugin';
11
+
15
12
  // eslint-disable-next-line no-unused-vars
16
13
  function configCSSMinifierPlugin(options) {
17
14
  const excludeList = options.optimization.cssExcludePath;
18
-
19
15
  if ((0, _modeUtils.isNotProduction)(options)) {
20
16
  return null;
21
- } // return null;
17
+ }
18
+ // return null;
22
19
  // return new UglifyCSSPlugin();
23
-
24
-
25
20
  return excludeList !== '' ? new _cssMinimizerWebpackPlugin.default({
26
21
  exclude: excludeList
27
22
  }) : new _cssMinimizerWebpackPlugin.default();
@@ -4,24 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configCdnChangePlugin = configCdnChangePlugin;
7
-
8
7
  var _modeUtils = require("../common/modeUtils");
9
-
10
8
  var _CdnChangePlugin = _interopRequireDefault(require("../custom_plugins/CdnChangePlugin"));
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 configCdnChangePlugin(options) {
15
11
  const {
16
12
  cdnMapping,
17
13
  mode
18
14
  } = options;
19
-
20
15
  if (!cdnMapping.isCdnEnabled || (0, _modeUtils.isDevelopmentMode)(mode)) {
21
16
  return null;
22
17
  }
23
-
24
- return new _CdnChangePlugin.default({ ...cdnMapping,
18
+ return new _CdnChangePlugin.default({
19
+ ...cdnMapping,
25
20
  createSeparateSMap: options.createSeparateSMap
26
21
  });
27
22
  }
@@ -4,19 +4,12 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configCopyPublicFolders = configCopyPublicFolders;
7
-
8
7
  var _path = _interopRequireDefault(require("path"));
9
-
10
8
  var _copyWebpackPlugin = _interopRequireDefault(require("copy-webpack-plugin"));
11
-
12
9
  var _fs = require("fs");
13
-
14
10
  var _updateArrayWithDefault = require("../utils/updateArrayWithDefault");
15
-
16
11
  var _constants = require("../../../constants");
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
20
13
  const defaultPublicFolders = [{
21
14
  // source must be relative path not absolute path
22
15
  source: 'public',
@@ -24,15 +17,12 @@ const defaultPublicFolders = [{
24
17
  target: 'public',
25
18
  toType: 'dir'
26
19
  }];
27
-
28
20
  function folderPatterns(publicFolders) {
29
21
  return publicFolders.map(conf => {
30
22
  const publicFolderActualPath = (0, _constants.joinWithAppPath)(conf.source);
31
-
32
23
  if (!conf.source || !conf.target || _path.default.isAbsolute(conf.source) || !(0, _fs.existsSync)(publicFolderActualPath)) {
33
24
  return null;
34
25
  }
35
-
36
26
  return {
37
27
  from: publicFolderActualPath,
38
28
  to: conf.target,
@@ -40,24 +30,19 @@ function folderPatterns(publicFolders) {
40
30
  };
41
31
  }).filter(Boolean);
42
32
  }
43
-
44
33
  function configCopyPublicFolders(options) {
45
34
  let {
46
35
  publicFolders,
47
36
  mode = 'dev'
48
37
  } = options;
49
38
  publicFolders = (0, _updateArrayWithDefault.updateArrayWithDefault)(publicFolders[mode], defaultPublicFolders);
50
-
51
39
  if (publicFolders.length === 0) {
52
40
  return null;
53
41
  }
54
-
55
42
  const patterns = folderPatterns(publicFolders);
56
-
57
43
  if (patterns.length === 0) {
58
44
  return null;
59
45
  }
60
-
61
46
  return new _copyWebpackPlugin.default({
62
47
  patterns
63
48
  });
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configCustomAttributesPlugin = configCustomAttributesPlugin;
7
-
8
7
  var _custom_attribute_plugin = require("../custom_plugins/custom_attribute_plugin");
9
-
10
8
  function configCustomAttributesPlugin(options) {
11
9
  const {
12
10
  customAttributes
13
11
  } = options;
14
-
15
12
  if (customAttributes.enable) {
16
13
  return new _custom_attribute_plugin.CustomAttributesPlugin(customAttributes);
17
14
  }
18
-
19
15
  return null;
20
16
  }
@@ -4,65 +4,49 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configCustomScriptLoadingStrategyPlugin = configCustomScriptLoadingStrategyPlugin;
7
-
8
7
  var _CustomScriptLoadingPlugin = require("../custom_plugins/CustomScriptLoadingPlugin");
9
-
10
8
  var _utils = require("../utils");
11
-
12
9
  const defaultScriptLoadingStrategy = 'defer';
13
10
  const allowedScriptLoadingStrategies = ['blocking', 'defer', 'async', 'module'];
14
-
15
11
  function isAllowedScriptLoadingStrategyUsed(scriptLoadingStategey) {
16
12
  return allowedScriptLoadingStrategies.includes(scriptLoadingStategey);
17
13
  }
18
-
19
14
  function getScriptLoadingStrategyForStringType(scriptLoadingStategey) {
20
15
  if (isAllowedScriptLoadingStrategyUsed(scriptLoadingStategey)) {
21
16
  return scriptLoadingStategey;
22
17
  }
23
-
24
18
  return defaultScriptLoadingStrategy;
25
19
  }
26
-
27
20
  function getScriptLoadingStrategyForObject(scriptLoadingStategey) {
28
21
  if (Object.keys(scriptLoadingStategey).length === 0) {
29
22
  return defaultScriptLoadingStrategy;
30
23
  }
31
-
32
24
  const isAllowedScriptLoadingStrategy = Object.keys(scriptLoadingStategey).every(key => isAllowedScriptLoadingStrategyUsed(key));
33
-
34
25
  if (isAllowedScriptLoadingStrategy) {
35
26
  return Object.assign({}, scriptLoadingStategey);
36
27
  }
37
-
38
28
  console.warn('un supported script loading strategy used', scriptLoadingStategey);
39
29
  return defaultScriptLoadingStrategy;
40
30
  }
41
-
42
31
  function getScriptLoadingStrategy(scriptLoadingStategey) {
43
32
  if ((0, _utils.getTypeOf)(scriptLoadingStategey) === 'string') {
44
33
  return {
45
34
  [getScriptLoadingStrategyForStringType(scriptLoadingStategey)]: [/.*/]
46
35
  };
47
36
  }
48
-
49
37
  if ((0, _utils.getTypeOf)(scriptLoadingStategey) === 'object') {
50
38
  return getScriptLoadingStrategyForObject(scriptLoadingStategey);
51
39
  }
52
-
53
40
  return {
54
41
  [defaultScriptLoadingStrategy]: [/.*/]
55
42
  };
56
43
  }
57
-
58
44
  function configCustomScriptLoadingStrategyPlugin(options) {
59
45
  const {
60
46
  customScriptLoadingStrategey
61
47
  } = options;
62
-
63
48
  if (customScriptLoadingStrategey) {
64
49
  const currentScriptLoadingStrategy = getScriptLoadingStrategy(customScriptLoadingStrategey.options);
65
-
66
50
  if ((0, _utils.getTypeOf)(currentScriptLoadingStrategy) === 'object') {
67
51
  return new _CustomScriptLoadingPlugin.CustomScriptLoadingStrategyPlugin({
68
52
  scriptLoadingStategey: currentScriptLoadingStrategy
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configEFCTemplatePlugin = configEFCTemplatePlugin;
7
-
8
7
  var _nameTemplates = require("../common/nameTemplates");
9
-
10
8
  var _EFCTemplatePlugin = require("../custom_plugins/EFCTemplatePlugin");
11
-
12
9
  function configEFCTemplatePlugin(options) {
13
10
  const {
14
11
  publicPath
@@ -27,11 +24,9 @@ function configEFCTemplatePlugin(options) {
27
24
  version,
28
25
  templateFilePath
29
26
  } = options.efc;
30
-
31
27
  if (!hasEFC || !createSDkFile) {
32
28
  return false;
33
29
  }
34
-
35
30
  const i18nFileNameTemplate = (0, _nameTemplates.nameTemplates)('i18njs', options);
36
31
  return new _EFCTemplatePlugin.EFCTemplatePlugin({
37
32
  entryPointName,
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configEnvVariables = configEnvVariables;
7
-
8
7
  var _webpack = require("webpack");
9
-
10
8
  var _modeUtils = require("../common/modeUtils");
11
-
12
9
  function getDevEnvs(NODE_ENV) {
13
10
  return {
14
11
  __CLIENT__: true,
@@ -23,7 +20,6 @@ function getDevEnvs(NODE_ENV) {
23
20
  }
24
21
  };
25
22
  }
26
-
27
23
  function getProdEnvs(isDevelopment) {
28
24
  return {
29
25
  __CLIENT__: true,
@@ -37,7 +33,6 @@ function getProdEnvs(isDevelopment) {
37
33
  }
38
34
  };
39
35
  }
40
-
41
36
  function configEnvVariables(options) {
42
37
  // const mode = getWebpackMode(options);
43
38
  const {
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configHtmlWebpackPlugin = configHtmlWebpackPlugin;
7
-
8
7
  var _constants = require("../../../constants");
9
-
10
8
  var _nameTemplates = require("../common/nameTemplates");
11
-
12
9
  var _modeUtils = require("../common/modeUtils");
13
-
14
10
  var _InitialHtmlPlugin = require("../custom_plugins/InitialHtmlPlugin");
15
-
16
11
  function configHtmlWebpackPlugin(options) {
17
12
  const {
18
13
  htmlTemplate,
@@ -23,7 +18,8 @@ function configHtmlWebpackPlugin(options) {
23
18
  templateFile
24
19
  } = htmlTemplate;
25
20
  const appInitialHTMLTemplatePath = (0, _constants.joinWithAppPath)(templateFile);
26
- const minifyHtmlOptions = (0, _modeUtils.isProductionMode)(mode) ? // eslint-disable-next-line no-use-before-define
21
+ const minifyHtmlOptions = (0, _modeUtils.isProductionMode)(mode) ?
22
+ // eslint-disable-next-line no-use-before-define
27
23
  getHTMLMinifyOptions(htmlTemplate) : false;
28
24
  return new _InitialHtmlPlugin.InitialHtmlPlugin({
29
25
  mainChunkName: 'main',
@@ -34,7 +30,6 @@ function configHtmlWebpackPlugin(options) {
34
30
  scriptLoading: 'defer'
35
31
  });
36
32
  }
37
-
38
33
  const defaultHTMLMiniFyOption = {
39
34
  collapseWhitespace: true,
40
35
  minifyCSS: true,
@@ -46,7 +41,6 @@ const defaultHTMLMiniFyOption = {
46
41
  removeStyleLinkTypeAttributes: true,
47
42
  useShortDoctype: true
48
43
  };
49
-
50
44
  function getHTMLMinifyOptions(htmlTemplate) {
51
45
  const {
52
46
  minify
@@ -4,26 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = configI18nIndexingPlugin;
7
-
8
7
  var _I18nNumericIndexPlugin = _interopRequireDefault(require("../custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexPlugin"));
9
-
10
8
  var _resourceBasedPublicPath = require("../common/resourceBasedPublicPath");
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 configI18nIndexingPlugin(config) {
15
11
  const {
16
12
  i18nIndexing,
17
13
  cdnMapping
18
14
  } = config;
19
-
20
15
  if (!i18nIndexing || !i18nIndexing.enable) {
21
16
  return null;
22
- } // Get the public path for i18n resources
23
-
17
+ }
24
18
 
25
- const i18nPublicPath = (0, _resourceBasedPublicPath.resourceBasedPublicPath)('i18n', config); // Get the CDN template for i18n resources if CDN is enabled
19
+ // Get the public path for i18n resources
20
+ const i18nPublicPath = (0, _resourceBasedPublicPath.resourceBasedPublicPath)('i18n', config);
26
21
 
22
+ // Get the CDN template for i18n resources if CDN is enabled
27
23
  const i18nCdnTemplate = cdnMapping && cdnMapping.isCdnEnabled ? cdnMapping.i18nTemplate || cdnMapping.jsTemplate : '';
28
24
  const options = {
29
25
  jsResourcePath: i18nIndexing.jsResourcePath,
@@ -4,18 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = configI18nNumericHtmlInjector;
7
-
8
7
  var _htmlWebpackPlugin = _interopRequireDefault(require("html-webpack-plugin"));
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
  const pluginName = 'I18nNumericHtmlInjectorPlugin';
13
-
14
10
  class I18nNumericHtmlInjectorPlugin {
15
11
  constructor(options) {
16
12
  this.options = options;
17
13
  }
18
-
19
14
  apply(compiler) {
20
15
  compiler.hooks.thisCompilation.tap(pluginName, compilation => {
21
16
  // Hook into HtmlWebpackPlugin to inject i18n script tags
@@ -30,56 +25,55 @@ class I18nNumericHtmlInjectorPlugin {
30
25
  i18nCdnTemplate,
31
26
  customGroups
32
27
  } = this.options;
33
- const newI18nAssets = []; // Add numeric i18n chunk
28
+ const newI18nAssets = [];
34
29
 
30
+ // Add numeric i18n chunk
35
31
  if (numericFilenameTemplate) {
36
- const numericFilename = numericFilenameTemplate.replace(/\[locale\]/g, htmlTemplateLabel).replace(/%5Blocale%5D/g, htmlTemplateLabel); // Don't add CDN template - HtmlWebpackPlugin handles it
37
-
32
+ const numericFilename = numericFilenameTemplate.replace(/\[locale\]/g, htmlTemplateLabel).replace(/%5Blocale%5D/g, htmlTemplateLabel);
33
+ // Don't add CDN template - HtmlWebpackPlugin handles it
38
34
  newI18nAssets.push(numericFilename);
39
- } // Add dynamic i18n chunk
40
-
35
+ }
41
36
 
37
+ // Add dynamic i18n chunk
42
38
  if (dynamicFilenameTemplate) {
43
- const dynamicFilename = dynamicFilenameTemplate.replace(/\[locale\]/g, htmlTemplateLabel).replace(/%5Blocale%5D/g, htmlTemplateLabel); // Don't add CDN template - HtmlWebpackPlugin handles it
44
-
39
+ const dynamicFilename = dynamicFilenameTemplate.replace(/\[locale\]/g, htmlTemplateLabel).replace(/%5Blocale%5D/g, htmlTemplateLabel);
40
+ // Don't add CDN template - HtmlWebpackPlugin handles it
45
41
  newI18nAssets.push(dynamicFilename);
46
- } // Add custom group chunks if they should be in initial HTML
47
-
42
+ }
48
43
 
44
+ // Add custom group chunks if they should be in initial HTML
49
45
  if (customGroups) {
50
46
  Object.entries(customGroups).forEach(([groupName, groupConfig]) => {
51
47
  // Only add to initial HTML if preload is true
52
48
  if (groupConfig.preload && groupConfig.filenameTemplate) {
53
- const groupFilename = groupConfig.filenameTemplate.replace(/\[locale\]/g, htmlTemplateLabel).replace(/%5Blocale%5D/g, htmlTemplateLabel); // Don't add CDN template - HtmlWebpackPlugin handles it
54
-
49
+ const groupFilename = groupConfig.filenameTemplate.replace(/\[locale\]/g, htmlTemplateLabel).replace(/%5Blocale%5D/g, htmlTemplateLabel);
50
+ // Don't add CDN template - HtmlWebpackPlugin handles it
55
51
  newI18nAssets.push(groupFilename);
56
52
  }
57
53
  });
58
- } // Prepend i18n assets to ensure they load before main bundle
59
-
54
+ }
60
55
 
56
+ // Prepend i18n assets to ensure they load before main bundle
61
57
  if (newI18nAssets.length > 0) {
62
58
  assets.js = [...newI18nAssets, ...assets.js];
63
59
  }
64
-
65
60
  return hookData;
66
61
  });
67
62
  });
68
63
  }
69
-
70
64
  }
71
-
72
65
  function configI18nNumericHtmlInjector(config) {
73
66
  const {
74
67
  i18nIndexing,
75
68
  cdnMapping
76
- } = config; // Only create this plugin if i18nIndexing is enabled
69
+ } = config;
77
70
 
71
+ // Only create this plugin if i18nIndexing is enabled
78
72
  if (!i18nIndexing || !i18nIndexing.enable) {
79
73
  return null;
80
- } // Get the CDN template for i18n resources if CDN is enabled
81
-
74
+ }
82
75
 
76
+ // Get the CDN template for i18n resources if CDN is enabled
83
77
  const i18nCdnTemplate = cdnMapping && cdnMapping.isCdnEnabled ? cdnMapping.i18nTemplate || cdnMapping.jsTemplate : '';
84
78
  const options = {
85
79
  numericFilenameTemplate: i18nIndexing.numericFilenameTemplate || 'i18n-chunk/[locale]/numeric.i18n.js',
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.configI18nNumericIndexPlugin = configI18nNumericIndexPlugin;
7
+ var _I18nNumericIndexPlugin = _interopRequireDefault(require("../custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexPlugin"));
8
+ var _I18nNumericIndexHtmlInjectorPlugin = require("../custom_plugins/I18nNumericIndexPlugin/I18nNumericIndexHtmlInjectorPlugin");
9
+ var _readI18nValues = require("../custom_plugins/I18nSplitPlugin/readI18nValues");
10
+ var _path = _interopRequireDefault(require("path"));
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ function configI18nNumericIndexPlugin(options) {
13
+ if (!(options.i18nIndexing && options.i18nIndexing.enable)) {
14
+ return null;
15
+ }
16
+ const i18nOpts = options.i18nIndexing;
17
+ const isDevelopment = options.isDevelopment || false; // Get isDevelopment from options
18
+
19
+ // Validate required options
20
+ const requiredOptions = ['jsResourcePath', 'propertiesFolderPath', 'numericMapPath', 'jsonpFunc', 'htmlTemplateLabel', 'localeVarName'];
21
+ const missingOptions = requiredOptions.filter(opt => !i18nOpts[opt]);
22
+ if (missingOptions.length > 0) {
23
+ console.warn(`[I18nNumericIndexPlugin] Missing required options: ${missingOptions.join(', ')}`);
24
+ return null;
25
+ }
26
+
27
+ // Read i18n values
28
+ const {
29
+ locales,
30
+ allI18nObject
31
+ } = (0, _readI18nValues.readI18nValues)({
32
+ jsResource: i18nOpts.jsResourcePath,
33
+ propertiesFolder: i18nOpts.propertiesFolderPath,
34
+ disableDefault: false
35
+ });
36
+
37
+ // Ensure templates have [locale] placeholder
38
+ const numericTemplate = i18nOpts.numericFilenameTemplate || '[locale]/numeric.i18n.js';
39
+ const dynamicTemplate = i18nOpts.dynamicFilenameTemplate || '[locale]/dynamic.i18n.js';
40
+ if (!numericTemplate.includes('[locale]')) {
41
+ console.warn('[I18nNumericIndexPlugin] numericFilenameTemplate must include [locale] placeholder');
42
+ return null;
43
+ }
44
+ if (!dynamicTemplate.includes('[locale]')) {
45
+ console.warn('[I18nNumericIndexPlugin] dynamicFilenameTemplate must include [locale] placeholder');
46
+ return null;
47
+ }
48
+
49
+ // Resolve singleFileTemplate if it's a function
50
+ let resolvedSingleFileTemplate = i18nOpts.singleFileTemplate || '[locale].js';
51
+ if (typeof i18nOpts.singleFileTemplate === 'function') {
52
+ resolvedSingleFileTemplate = i18nOpts.singleFileTemplate(isDevelopment);
53
+ }
54
+
55
+ // Plugin options
56
+ const numericIndexPluginOptions = {
57
+ enable: i18nOpts.enable,
58
+ outputFolder: i18nOpts.outputFolder || 'i18n-chunk',
59
+ jsResourcePath: i18nOpts.jsResourcePath,
60
+ propertiesFolderPath: i18nOpts.propertiesFolderPath,
61
+ numericMapPath: i18nOpts.numericMapPath,
62
+ locales,
63
+ allI18nObject,
64
+ numericFilenameTemplate: numericTemplate,
65
+ dynamicFilenameTemplate: dynamicTemplate,
66
+ singleFileTemplate: resolvedSingleFileTemplate,
67
+ jsonpFunc: i18nOpts.jsonpFunc,
68
+ localeVarName: i18nOpts.localeVarName,
69
+ singleFile: i18nOpts.singleFile || false,
70
+ includeContentHash: i18nOpts.includeContentHash || false,
71
+ generateManifest: i18nOpts.generateManifest || false,
72
+ manifestPath: i18nOpts.manifestPath || null,
73
+ customGroups: i18nOpts.customGroups || null,
74
+ isDevelopment: isDevelopment // Pass through for reference
75
+ };
76
+
77
+ // HTML injector options
78
+ const htmlInjectorOptions = {
79
+ outputFolder: i18nOpts.outputFolder || 'i18n-chunk',
80
+ numericFilenameTemplate: numericTemplate,
81
+ dynamicFilenameTemplate: dynamicTemplate,
82
+ singleFileTemplate: resolvedSingleFileTemplate,
83
+ htmlTemplateLabel: i18nOpts.htmlTemplateLabel,
84
+ singleFile: i18nOpts.singleFile || false,
85
+ i18nAssetsPublicPathPrefix: '',
86
+ // HtmlWebpackPlugin handles publicPath
87
+ isDevelopment: isDevelopment
88
+ };
89
+ const i18nNumericPluginInstance = new _I18nNumericIndexPlugin.default(numericIndexPluginOptions);
90
+ const htmlInjectorPluginInstance = new _I18nNumericIndexHtmlInjectorPlugin.I18nNumericIndexHtmlInjectorPlugin(htmlInjectorOptions);
91
+ return [i18nNumericPluginInstance, htmlInjectorPluginInstance];
92
+ }
@@ -4,25 +4,19 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configI18nSplitPlugin = configI18nSplitPlugin;
7
-
8
7
  var _nameTemplates = require("../common/nameTemplates");
9
-
10
8
  var _I18nSplitPlugin = _interopRequireDefault(require("../custom_plugins/I18nSplitPlugin"));
11
-
12
9
  var _resourceBasedPublicPath = require("../common/resourceBasedPublicPath");
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 configI18nSplitPlugin(options) {
17
12
  const {
18
13
  i18nChunkSplit
19
14
  } = options;
20
-
21
15
  if (!i18nChunkSplit.chunkSplitEnable) {
22
16
  return null;
23
17
  }
24
-
25
- const i18nPublicPath = (0, _resourceBasedPublicPath.resourceBasedPublicPath)('i18n', options); // const i18nPublicPathAsExpression = publicPathAsExpression('i18n', options);
18
+ const i18nPublicPath = (0, _resourceBasedPublicPath.resourceBasedPublicPath)('i18n', options);
19
+ // const i18nPublicPathAsExpression = publicPathAsExpression('i18n', options);
26
20
 
27
21
  return new _I18nSplitPlugin.default({
28
22
  mainChunkName: 'main',
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configIgnorePlugin = configIgnorePlugin;
7
-
8
7
  var _webpack = require("webpack");
9
-
10
8
  // eslint-disable-next-line no-unused-vars
11
9
  function configIgnorePlugin(options) {
12
10
  return new _webpack.IgnorePlugin({
@@ -4,26 +4,21 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configManifestJsonPlugin = configManifestJsonPlugin;
7
-
8
7
  var _ManifestJsonPlugin = require("../custom_plugins/ManifestJsonPlugin");
9
-
10
8
  function configManifestJsonPlugin(options) {
11
9
  const {
12
10
  enable,
13
11
  i18nManifestJson,
14
12
  licenseManifest
15
13
  } = options.manifestJson;
16
-
17
14
  if (!enable) {
18
15
  return null;
19
16
  }
20
-
21
17
  const params = [{
22
18
  outputJsonFileName: 'manifest.json',
23
19
  test: f => !/\.i18n\.js$|\.LICENSE\.txt$|\.map$/.test(f),
24
20
  needInitialEntries: true
25
21
  }];
26
-
27
22
  if (i18nManifestJson) {
28
23
  params.push({
29
24
  outputJsonFileName: 'i18nManifest.json',
@@ -31,7 +26,6 @@ function configManifestJsonPlugin(options) {
31
26
  needInitialEntries: false
32
27
  });
33
28
  }
34
-
35
29
  if (licenseManifest) {
36
30
  params.push({
37
31
  outputJsonFileName: 'licenseManifest.json',
@@ -39,6 +33,5 @@ function configManifestJsonPlugin(options) {
39
33
  needInitialEntries: false
40
34
  });
41
35
  }
42
-
43
36
  return new _ManifestJsonPlugin.AddFileToManifestJson(params);
44
37
  }
@@ -4,19 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configMiniCSSExtractPlugin = configMiniCSSExtractPlugin;
7
-
8
7
  var _miniCssExtractPlugin = _interopRequireDefault(require("mini-css-extract-plugin"));
9
-
10
8
  var _nameTemplates = require("../common/nameTemplates");
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 configMiniCSSExtractPlugin(options) {
15
11
  const {
16
12
  enableRTLSplit
17
13
  } = options.css.plugins.rtlSplit;
18
- const cssLTRFileNameTempalte = enableRTLSplit ? (0, _nameTemplates.nameTemplates)('cssdir', options) : (0, _nameTemplates.nameTemplates)('css', options); // eslint-disable-next-line no-undef
19
-
14
+ const cssLTRFileNameTempalte = enableRTLSplit ? (0, _nameTemplates.nameTemplates)('cssdir', options) : (0, _nameTemplates.nameTemplates)('css', options);
15
+ // eslint-disable-next-line no-undef
20
16
  return new _miniCssExtractPlugin.default({
21
17
  filename: cssLTRFileNameTempalte,
22
18
  chunkFilename: cssLTRFileNameTempalte
@@ -4,17 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.configProgressPlugin = configProgressPlugin;
7
-
8
7
  var _webpack = _interopRequireDefault(require("webpack"));
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
  // eslint-disable-next-line no-unused-vars
13
10
  function configProgressPlugin(options) {
14
11
  if (!options.printProgress) {
15
12
  return null;
16
13
  }
17
-
18
14
  return new _webpack.default.ProgressPlugin({
19
15
  handler: (percentage, message, ...args) => {
20
16
  // eslint-disable-next-line no-console