@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,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _htmlWebpackPlugin = _interopRequireDefault(require("html-webpack-plugin"));
9
-
10
8
  var _JavascriptModulesPlugin = _interopRequireDefault(require("webpack/lib/javascript/JavascriptModulesPlugin"));
11
-
12
9
  var _replaceCssDirTemplate = require("./replaceCssDirTemplate");
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
  // import { JavascriptModulesPlugin } from 'webpack';
17
- const pluginName = 'OverwriteCssPathForRTL';
18
12
 
13
+ const pluginName = 'OverwriteCssPathForRTL';
19
14
  class OverwriteCssPathForRTL {
20
15
  constructor(options = {
21
16
  dirVarName: 'document.dir'
@@ -23,40 +18,36 @@ class OverwriteCssPathForRTL {
23
18
  this.dirVarName = options.dirVarName || 'document.dir';
24
19
  this.templateLabel = options.templateLabel || '{{--dir}}';
25
20
  }
26
-
27
21
  overwriteCssPathinHTML(compilation) {
28
22
  // NOTE: need to reconsider It is not working as expected
29
23
  _htmlWebpackPlugin.default.getHooks(compilation).beforeAssetTagGeneration.tap(pluginName, data => {
30
24
  const {
31
25
  assets
32
26
  } = data;
33
- return { ...data,
34
- assets: { ...assets,
27
+ return {
28
+ ...data,
29
+ assets: {
30
+ ...assets,
35
31
  css: assets.css && (0, _replaceCssDirTemplate.replaceCssDirTemplateMapper)(assets.css, this.templateLabel)
36
32
  }
37
33
  };
38
34
  });
39
35
  }
40
-
41
36
  overwriteCssPathinRequireEnsure(compilation, compiler) {
42
37
  const {
43
38
  RawSource
44
39
  } = compiler.webpack.sources;
45
-
46
40
  _JavascriptModulesPlugin.default.getCompilationHooks(compilation).renderMain.tap(pluginName, source => {
47
41
  const templateText = `"+(${this.dirVarName} === "rtl" ? "rtl": "ltr")+"`;
48
42
  const replacedStr = source.source().replace(/\[dir\]/g, templateText);
49
43
  return new RawSource(replacedStr);
50
44
  });
51
45
  }
52
-
53
46
  apply(compiler) {
54
47
  compiler.hooks.thisCompilation.tap(pluginName, compilation => {
55
48
  this.overwriteCssPathinHTML(compilation);
56
49
  this.overwriteCssPathinRequireEnsure(compilation, compiler);
57
50
  });
58
51
  }
59
-
60
52
  }
61
-
62
53
  exports.default = OverwriteCssPathForRTL;
@@ -4,21 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.RtlCssPlugin = void 0;
7
-
8
7
  var _webpack = require("webpack");
9
-
10
8
  var _OverwriteCssPathForRTL = _interopRequireDefault(require("./OverwriteCssPathForRTL"));
11
-
12
9
  var _RTLSplitPlugin = require("../../../../postcss/custom_postcss_plugins/RTLSplitPlugin");
13
-
14
10
  var _utils = require("../../utils");
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
  // import HtmlWebpackPlugin from 'html-webpack-plugin';
19
13
  // import rtlcss from 'rtlcss';
20
- const pluginName = 'RtlCssPlugin';
21
14
 
15
+ const pluginName = 'RtlCssPlugin';
22
16
  class RtlCssPlugin {
23
17
  constructor(options = {}) {
24
18
  /**
@@ -38,7 +32,6 @@ class RtlCssPlugin {
38
32
  disableMinifySelector: options.disableMinifySelector
39
33
  };
40
34
  }
41
-
42
35
  apply(compiler) {
43
36
  const {
44
37
  RawSource
@@ -46,12 +39,12 @@ class RtlCssPlugin {
46
39
  new _OverwriteCssPathForRTL.default({
47
40
  templateLabel: this.templateLabel,
48
41
  dirVarName: this.dirVarName
49
- }).apply(compiler); // const { filename, sourcemap, config } = this.options;
42
+ }).apply(compiler);
43
+ // const { filename, sourcemap, config } = this.options;
50
44
  // const { devtool } = compiler.options;
51
45
  // const postcssOptions = {
52
46
  // map: (sourcemap === undefined && !!devtool) || !!sourcemap
53
47
  // };
54
-
55
48
  compiler.hooks.compilation.tap(pluginName, compilation => {
56
49
  // compilation.hooks.shouldGenerateChunkAssets.tap(pluginName, (...args) => {
57
50
  // console.log('shouldGenerateChunkAssets', args);
@@ -78,7 +71,5 @@ class RtlCssPlugin {
78
71
  });
79
72
  });
80
73
  }
81
-
82
74
  }
83
-
84
75
  exports.RtlCssPlugin = RtlCssPlugin;
@@ -7,21 +7,19 @@ exports.replaceCssDirTemplate = replaceCssDirTemplate;
7
7
  exports.replaceCssDirTemplateMapper = replaceCssDirTemplateMapper;
8
8
  exports.replaceI18nLocalTemplate = replaceI18nLocalTemplate;
9
9
  exports.replaceI18nLocaleTemplateMapper = replaceI18nLocaleTemplateMapper;
10
-
11
10
  function replaceCssDirTemplate(filePath, cssDirTemplate) {
12
- return filePath // added for efc and service worker handling
11
+ return filePath
12
+ // added for efc and service worker handling
13
13
  .replaceAll('[dir]', cssDirTemplate).replace('.ltr.css', `.${cssDirTemplate}.css`);
14
14
  }
15
-
16
15
  function replaceCssDirTemplateMapper(assets, cssDirTemplate) {
17
16
  return assets.map(filePath => replaceCssDirTemplate(filePath, cssDirTemplate));
18
17
  }
19
-
20
18
  function replaceI18nLocalTemplate(filePath, localeTemplate) {
21
- return filePath // added for efc and service worker handling
19
+ return filePath
20
+ // added for efc and service worker handling
22
21
  .replaceAll('[locale]', localeTemplate);
23
22
  }
24
-
25
23
  function replaceI18nLocaleTemplateMapper(assets, localeTemplate) {
26
24
  return assets.map(filePath => replaceI18nLocalTemplate(filePath, localeTemplate));
27
25
  }
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _webpack = require("webpack");
9
-
10
8
  const pluginName = 'RuntimeResourceCleanupPlugin';
11
-
12
9
  class RuntimeResourceCleanup {
13
10
  constructor({
14
11
  enable: scriptCleanUpEnabled,
@@ -19,7 +16,6 @@ class RuntimeResourceCleanup {
19
16
  this.scriptCleanUpEnabled = scriptCleanUpEnabled;
20
17
  this.chunkLoadingGlobal = chunkLoadingGlobal;
21
18
  }
22
-
23
19
  apply(compiler) {
24
20
  compiler.hooks.compilation.tap(pluginName, compilation => {
25
21
  compilation.hooks.processAssets.tap({
@@ -28,7 +24,6 @@ class RuntimeResourceCleanup {
28
24
  }, assets => {
29
25
  const runtimeFiles = Object.keys(assets).filter(assetName => /.+?runtime.*\.js$/.test(assetName));
30
26
  const searchString = 'chunkLoadingGlobal.forEach';
31
-
32
27
  function generateScriptCleanUpCode(attributes) {
33
28
  const [[attributeKey, attributeValue]] = Object.entries(attributes);
34
29
  const selectorForGettingResources = `[${attributeKey}="${attributeValue}"]`;
@@ -36,7 +31,6 @@ class RuntimeResourceCleanup {
36
31
  document.querySelectorAll('${selectorForGettingResources}').forEach(resource => resource.remove());
37
32
  `;
38
33
  }
39
-
40
34
  function generateRunTimeObjectCleanupCode() {
41
35
  return `
42
36
  Object.keys(__webpack_modules__).forEach(moduleKey => __webpack_modules__[moduleKey] = null);
@@ -47,7 +41,6 @@ class RuntimeResourceCleanup {
47
41
  __webpack_require__ = null;
48
42
  `;
49
43
  }
50
-
51
44
  function attachUninstallMethodToChunkGlobal() {
52
45
  const {
53
46
  chunkLoadingGlobal
@@ -57,7 +50,6 @@ class RuntimeResourceCleanup {
57
50
  ${this.scriptCleanUpEnabled ? generateScriptCleanUpCode(this.options.attributes) : ''}
58
51
  }`;
59
52
  }
60
-
61
53
  runtimeFiles.forEach(runtTimeFile => {
62
54
  const runTimeSource = assets[runtTimeFile].source();
63
55
  const newRunTimeCode = runTimeSource.replace(searchString, `${attachUninstallMethodToChunkGlobal.call(this)};${searchString}`);
@@ -67,7 +59,5 @@ class RuntimeResourceCleanup {
67
59
  });
68
60
  });
69
61
  }
70
-
71
62
  }
72
-
73
63
  exports.default = RuntimeResourceCleanup;
@@ -6,15 +6,12 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.hasPrevNodeIgnore = hasPrevNodeIgnore;
7
7
  exports.isAtRule = isAtRule;
8
8
  exports.isInsideMediaQuery = isInsideMediaQuery;
9
-
10
9
  function hasPrevNodeIgnore(index, prevNode, ignoreComment) {
11
10
  return index !== 0 && prevNode && prevNode.type && prevNode.type === 'comment' && prevNode.text.toLowerCase() === ignoreComment;
12
11
  }
13
-
14
12
  function isAtRule(rule) {
15
13
  return rule.parent && rule.parent.type === 'atrule';
16
14
  }
17
-
18
15
  function isInsideMediaQuery(rule) {
19
16
  return !!(isAtRule(rule) && rule.parent.name === 'media');
20
17
  }
@@ -4,17 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _postcss = _interopRequireDefault(require("postcss"));
9
-
10
8
  var _fs = _interopRequireDefault(require("fs"));
11
-
12
9
  var _selectorWeightPrefixAdder = require("./selectorWeightPrefixAdder");
13
-
14
10
  var _checkIsPatternsMatchFilename = require("../../loaderConfigs/checkIsPatternsMatchFilename");
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
  class SelectorWeightPlugin {
19
13
  constructor(options = {}) {
20
14
  this.options = {
@@ -25,7 +19,6 @@ class SelectorWeightPlugin {
25
19
  patterns: options.patterns
26
20
  };
27
21
  }
28
-
29
22
  apply(compiler) {
30
23
  const {
31
24
  defaultSelector,
@@ -33,16 +26,13 @@ class SelectorWeightPlugin {
33
26
  excludeStrings,
34
27
  patterns
35
28
  } = this.options;
36
-
37
29
  const rawdata = _fs.default.readFileSync(customFileDetails);
38
-
39
30
  const data = JSON.parse(rawdata);
40
31
  compiler.hooks.compilation.tap('selector-weight-rewrite', compilation => {
41
32
  compilation.hooks.optimizeModules.tap('selector-weight-rewrite', modules => {
42
33
  const mods = Array.from(modules).filter(x => x.type.includes('css'));
43
34
  mods.forEach(module => {
44
35
  const filename = module.issuer.resource;
45
-
46
36
  if (!(0, _checkIsPatternsMatchFilename.checkIsPatternsMatchFilename)(patterns, filename)) {
47
37
  return;
48
38
  }
@@ -61,18 +51,12 @@ class SelectorWeightPlugin {
61
51
  case filename is different ?
62
52
  defaultSelector = '.zoho_desk_ui'
63
53
  */
64
-
65
-
66
- const rootOriginal = _postcss.default.parse(module.content); // eslint-disable-next-line no-param-reassign
67
-
68
-
54
+ const rootOriginal = _postcss.default.parse(module.content);
55
+ // eslint-disable-next-line no-param-reassign
69
56
  module.content = (0, _selectorWeightPrefixAdder.selectorWeightPrefixAdder)(rootOriginal, data[filename] ? data[filename].defaultSelector : defaultSelector, excludeStrings).toString();
70
57
  });
71
58
  });
72
59
  });
73
60
  }
74
-
75
61
  }
76
-
77
- var _default = SelectorWeightPlugin;
78
- exports.default = _default;
62
+ var _default = exports.default = SelectorWeightPlugin;
@@ -4,48 +4,46 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.selectorWeightPrefixAdder = selectorWeightPrefixAdder;
7
-
8
7
  var _classHandling = require("./classHandling");
9
-
10
8
  function selectorWeightPrefixAdder(rootOriginal, selector, excludeStrings) {
11
9
  rootOriginal.walkRules((rule, index) => {
12
10
  const prevNode = rootOriginal.nodes[index - 1];
13
-
14
11
  if ((0, _classHandling.hasPrevNodeIgnore)(index, prevNode, 'updateselector:ignore')) {
15
12
  return;
16
- } // TODO: need to verify cases
13
+ }
14
+ // TODO: need to verify cases
17
15
  // if (!isInsideMediaQuery(rule)) {
18
16
  // return;
19
17
  // }
20
-
21
-
22
18
  const selectorArr = rule.selector.split(',');
23
19
  selectorArr.forEach((singleSelectorStr, index) => {
24
20
  if (excludeStrings.includes(singleSelectorStr.trim())) {
25
21
  return;
26
22
  }
27
-
28
23
  if (singleSelectorStr.includes(']')) {
29
24
  if (singleSelectorStr.slice(singleSelectorStr.lastIndexOf(']') + 2).trim() === '') {
30
25
  return;
31
26
  }
32
-
33
27
  selectorArr[index] = `${singleSelectorStr.slice(0, singleSelectorStr.lastIndexOf(']') + 1).trim()} ${selector}${singleSelectorStr.slice(singleSelectorStr.lastIndexOf(']') + 2).trim()}`;
34
28
  return;
35
29
  }
36
-
37
30
  selectorArr[index] = `${selector}${singleSelectorStr}`;
38
- }); // eslint-disable-next-line no-param-reassign
39
-
31
+ });
32
+ // eslint-disable-next-line no-param-reassign
40
33
  rule.selector = selectorArr.join(',\n');
41
34
  });
42
35
  return rootOriginal;
43
- } // function convertSelectorWithoutAttribute (selector, conjunction) {
36
+ }
37
+
38
+ // function convertSelectorWithoutAttribute (selector, conjunction) {
44
39
  // const front = selector
45
40
  // .slice(0, selector.lastIndexOf(']') + 1)
46
41
  // .trim();
42
+
47
43
  // const back = selector
48
44
  // .slice(selector.lastIndexOf(']') + 2)
49
45
  // .trim();
46
+
50
47
  // return `${front} ${conjunction}${back}`;
48
+
51
49
  // }
@@ -6,11 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.windowsModification = windowsModification;
7
7
  exports.windowsModificationFile = windowsModificationFile;
8
8
  const isWin = process.platform === 'win32';
9
-
10
9
  function windowsModification(array) {
11
10
  return isWin ? array && Array.isArray(array) && array.map(r => r.replace(/\//g, '\\')) : array;
12
11
  }
13
-
14
12
  function windowsModificationFile(filename) {
15
13
  return isWin ? filename.replace(/\//g, '\\') : filename;
16
- } // module.exports = { windowsModification, windowsModificationFile };
14
+ }
15
+ // module.exports = { windowsModification, windowsModificationFile };
@@ -4,21 +4,13 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _fs = require("fs");
9
-
10
8
  var _LocaleChunkAssetsStore = require("./I18nSplitPlugin/LocaleChunkAssetsStore");
11
-
12
9
  var _emitAsset = require("./emitAsset");
13
-
14
10
  var _replaceCssDirTemplate = require("./RtlSplitPlugin/replaceCssDirTemplate");
15
-
16
11
  var _getInitialAssetsFuncTemplate = require("./getInitialAssetsFuncTemplate");
17
-
18
12
  var _ServiceWorkerPluginUtils = require("./ServiceWorkerPluginUtils");
19
-
20
13
  const pluginName = 'ServiceWorkerPlugin';
21
-
22
14
  class ServiceWorkerPlugin {
23
15
  constructor(options) {
24
16
  this.templateFilePath = options.templateFilePath;
@@ -28,18 +20,17 @@ class ServiceWorkerPlugin {
28
20
  this.chunkSplitEnable = options.chunkSplitEnable;
29
21
  this.enableRTLSplit = options.enableRTLSplit;
30
22
  this.entryPointName = options.entryPointName;
31
- this.replaceText = options.replaceText; // this.publicPaths = options.publicPaths;
32
- } // eslint-disable-next-line class-methods-use-this
33
-
23
+ this.replaceText = options.replaceText;
24
+ // this.publicPaths = options.publicPaths;
25
+ }
34
26
 
27
+ // eslint-disable-next-line class-methods-use-this
35
28
  isInitialChunk(chunk) {
36
29
  if ('canBeInitial' in chunk) {
37
30
  return chunk.canBeInitial();
38
31
  }
39
-
40
32
  return chunk.isInitial();
41
33
  }
42
-
43
34
  apply(compiler) {
44
35
  compiler.hooks.thisCompilation.tap(pluginName, compilation => {
45
36
  // Get store for cache
@@ -54,7 +45,6 @@ class ServiceWorkerPlugin {
54
45
  });
55
46
  });
56
47
  }
57
-
58
48
  createServiceWorkerFile(compilation) {
59
49
  const {
60
50
  templateFilePath,
@@ -76,15 +66,16 @@ class ServiceWorkerPlugin {
76
66
  i18nFileNameTemplate: this.i18nFileNameTemplate,
77
67
  functionName: 'getInitialAssets'
78
68
  });
69
+
79
70
  /**
80
71
  * NOTE:
81
72
  * if chunkSplitEnable is false means,
82
73
  * serviceWorker will get i18n files path for html
83
74
  */
84
75
  // chunkSplitEnable &&
85
-
86
76
  [...compilation.chunks].filter(c => !this.isInitialChunk(c)).forEach(chunk => {
87
- allChunkUrls = [...allChunkUrls, ...chunk.files]; // allI18nAssets.push(
77
+ allChunkUrls = [...allChunkUrls, ...chunk.files];
78
+ // allI18nAssets.push(
88
79
  // getI18nFileUrlPathTemplate(
89
80
  // compilation,
90
81
  // chunk,
@@ -95,11 +86,9 @@ class ServiceWorkerPlugin {
95
86
  });
96
87
  allChunkUrls = allChunkUrls.filter(fileName => !fileName.endsWith('.map'));
97
88
  allChunkUrls = allChunkUrls.map(fileName => fileName.replace('smap/', ''));
98
-
99
89
  if (enableRTLSplit) {
100
90
  allChunkUrls = (0, _replaceCssDirTemplate.replaceCssDirTemplateMapper)(allChunkUrls, _getInitialAssetsFuncTemplate.cssDirTemplate);
101
91
  }
102
-
103
92
  const mod = templateContent.replace(this.replaceText, `
104
93
  ${initialAssetsFuncTemplate}
105
94
 
@@ -114,7 +103,5 @@ class ServiceWorkerPlugin {
114
103
  self.allChunks = ${JSON.stringify(allChunkUrls.concat(allI18nAssets))};`);
115
104
  (0, _emitAsset.emitAsset)(compilation, outputFilePath, mod);
116
105
  }
117
-
118
106
  }
119
-
120
107
  exports.default = ServiceWorkerPlugin;
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getI18nFileUrlPathTemplate = getI18nFileUrlPathTemplate;
7
-
8
7
  function getI18nFileUrlPathTemplate(compilation, chunk, filenameTemplate, localeTemplate) {
9
8
  const urlpath = compilation.getPath(filenameTemplate, {
10
9
  chunk
@@ -4,20 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.SourceMapPlugin = void 0;
7
-
8
7
  var _webpack = require("webpack");
9
-
10
8
  /* eslint-disable class-methods-use-this */
9
+
11
10
  function checkSmapFilePattern(assetName) {
12
11
  return /\.js$/.test(assetName) && !/\.i18n\.js$/.test(assetName) || /\.js\.map$/.test(assetName) && !/\.i18n\.js\.map$/.test(assetName);
13
12
  }
14
-
15
13
  function skipRuntimeFiles(assetName) {
16
14
  return !assetName.includes('[locale]');
17
15
  }
16
+ const pluginName = 'SplitSourceMapPlugin';
18
17
 
19
- const pluginName = 'SplitSourceMapPlugin'; // Purpose:
20
-
18
+ // Purpose:
21
19
  /**
22
20
  * we want build that can load files source map and without sourcemap at the same time,
23
21
  * or can be mentioned as so single build need to support two different clients that one for fast load and one for debugging.
@@ -35,16 +33,16 @@ class SourceMapPlugin {
35
33
  }, assets => {
36
34
  Object.keys(assets).forEach(assetName => {
37
35
  const assetCode = assets[assetName].source();
38
-
39
36
  if (checkSmapFilePattern(assetName) && skipRuntimeFiles(assetName)) {
40
37
  compilation.renameAsset(assetName, `smap/${assetName}`);
41
-
42
38
  if (!/\.map$/.test(assetName)) {
43
39
  compilation.emitAsset(assetName, new RawSource(assetCode));
44
40
  }
45
41
  }
46
42
  });
47
- }); // if contenthash enabled we need to add this to include the runtime files
43
+ });
44
+ // if contenthash enabled we need to add this to include the runtime files
45
+
48
46
  // compilation.hooks.processAssets.tap(
49
47
  // {
50
48
  // name: pluginName,
@@ -62,10 +60,9 @@ class SourceMapPlugin {
62
60
  // );
63
61
  // };
64
62
  // });
63
+
65
64
  // });
66
65
  });
67
66
  }
68
-
69
67
  }
70
-
71
68
  exports.SourceMapPlugin = SourceMapPlugin;
@@ -4,19 +4,14 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.addHashToFilePath = addHashToFilePath;
7
-
8
7
  var _path = _interopRequireDefault(require("path"));
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 addHashToFilePath(filePath, hash) {
13
10
  const pathObj = _path.default.parse(filePath);
14
-
15
11
  const updatedFilePath = _path.default.format({
16
12
  dir: pathObj.dir,
17
13
  name: `${pathObj.name}.${hash}`,
18
14
  ext: pathObj.ext
19
15
  });
20
-
21
16
  return updatedFilePath;
22
17
  }
@@ -4,44 +4,31 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.TPHashMappingPlugin = void 0;
7
-
8
7
  var _webpack = require("webpack");
9
-
10
8
  var _fs = _interopRequireDefault(require("fs"));
11
-
12
9
  var _path = _interopRequireDefault(require("path"));
13
-
14
10
  var _addHashToFilePath = require("./addHashToFilePath");
15
-
16
11
  var _cssClassNameGenerate = require("../../loaderConfigs/cssClassNameGenerate");
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
  class TPHashMappingPlugin {
21
14
  constructor(options) {
22
15
  this.fileMappings = options.fileMappings;
23
16
  this.tpFolder = options.tpFolder;
24
17
  }
25
-
26
18
  apply(compiler) {
27
19
  new _webpack.DefinePlugin(this.getFiles()).apply(compiler);
28
20
  }
29
-
30
21
  getFiles() {
31
22
  const hashMapping = {};
32
23
  this.fileMappings.forEach(fileInfo => {
33
24
  const filePath = _path.default.join(this.tpFolder, fileInfo.filePath);
34
-
35
25
  if (_fs.default.existsSync(filePath)) {
36
26
  const fileContent = _fs.default.readFileSync(filePath, {
37
27
  encoding: 'utf-8'
38
28
  });
39
-
40
29
  const generatedHash = (0, _cssClassNameGenerate.getHash)(fileContent, fileInfo.hashLength || 10);
41
30
  const outputFilePath = (0, _addHashToFilePath.addHashToFilePath)(filePath, generatedHash);
42
-
43
31
  _fs.default.writeFileSync(outputFilePath, fileContent);
44
-
45
32
  hashMapping[fileInfo.key] = JSON.stringify(generatedHash);
46
33
  } else {
47
34
  throw new Error(`Third party file ${fileInfo.fileName} does not exist`);
@@ -49,7 +36,5 @@ class TPHashMappingPlugin {
49
36
  });
50
37
  return hashMapping;
51
38
  }
52
-
53
39
  }
54
-
55
40
  exports.TPHashMappingPlugin = TPHashMappingPlugin;
@@ -4,17 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _uglifycss = _interopRequireDefault(require("uglifycss"));
9
-
10
8
  var _webpack = require("webpack");
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
  /* eslint-disable class-methods-use-this */
15
11
  // import { RawSource } from 'webpack-sources';
16
- const pluginName = 'UglifyCSSPlugin'; // TODO: Check for css minimizer plugin
17
12
 
13
+ const pluginName = 'UglifyCSSPlugin';
14
+
15
+ // TODO: Check for css minimizer plugin
18
16
  class UglifyCSSPlugin {
19
17
  apply(compiler) {
20
18
  const {
@@ -28,13 +26,10 @@ class UglifyCSSPlugin {
28
26
  Object.keys(assets).filter(filename => /\.css$/.test(filename)).forEach(filename => {
29
27
  try {
30
28
  let asset = assets[filename].source();
31
-
32
29
  if (typeof asset !== 'string') {
33
30
  asset = asset.toString();
34
31
  }
35
-
36
32
  const result = _uglifycss.default.processString(asset);
37
-
38
33
  compilation.updateAsset(filename, new RawSource(result));
39
34
  } catch (e) {
40
35
  compilation.errors.push(e);
@@ -43,7 +38,5 @@ class UglifyCSSPlugin {
43
38
  });
44
39
  });
45
40
  }
46
-
47
41
  }
48
-
49
42
  exports.default = UglifyCSSPlugin;
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.errHandler = exports.ErrorHandler = void 0;
7
-
8
7
  class ErrorHandler {
9
8
  constructor(allowedErrs) {
10
9
  this.errors = [];
@@ -20,7 +19,6 @@ class ErrorHandler {
20
19
  MULTIPLE_OCCURANCES: errObj => this.addError(` prop: ${errObj.decl.prop} ,\n value : ${errObj.decl.value} ,\n filename : ${errObj.filename} ,\n filepath : ${errObj.path} ,\n line : ${errObj.decl.source.start.line} ,\n message : ${errObj.message}`)
21
20
  });
22
21
  }
23
-
24
22
  setAllowedErrs(allErrs) {
25
23
  this.allowedErrs = allErrs;
26
24
  ['DECLARATION_IGNORED', 'DECIMAL_CHECK', 'DECIMAL_REJECT', 'UNIT_ERROR', 'RANGE_ERROR', 'VARIABLE_PRESENT', 'MULTIPLE_OCCURANCES'].forEach(err => {
@@ -29,18 +27,16 @@ class ErrorHandler {
29
27
  }
30
28
  });
31
29
  }
32
-
33
30
  addError(errstr) {
34
31
  this.errors.push(`{\n${errstr}\n}\n`);
35
32
  }
36
-
37
33
  errorFunction(errObj) {
38
34
  if (errObj.type && this.allowedErrs[errObj.type] && errObj.decl.prop && errObj.decl.value) {
39
35
  this[errObj.type](errObj);
40
36
  }
41
- } // eslint-disable-next-line class-methods-use-this
42
-
37
+ }
43
38
 
39
+ // eslint-disable-next-line class-methods-use-this
44
40
  printError(errObj) {
45
41
  console.log('{');
46
42
  Object.keys(errObj).sort().forEach(key => {
@@ -54,9 +50,6 @@ class ErrorHandler {
54
50
  });
55
51
  console.log('}\n');
56
52
  }
57
-
58
53
  }
59
-
60
54
  exports.ErrorHandler = ErrorHandler;
61
- const errHandler = new ErrorHandler();
62
- exports.errHandler = errHandler;
55
+ const errHandler = exports.errHandler = new ErrorHandler();