@zohodesk/client_build_tool 0.0.6-exp.28 → 0.0.6-exp.29

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.
@@ -330,6 +330,10 @@ var _default = {
330
330
  value: false,
331
331
  cli: 'type_script_enable'
332
332
  }
333
+ },
334
+ optimization: {
335
+ jsExcludePath: '',
336
+ cssExcludePath: ''
333
337
  }
334
338
  };
335
339
  exports.default = _default;
@@ -29,7 +29,7 @@ class TPHashMappingPlugin {
29
29
 
30
30
  getFiles() {
31
31
  const hashMapping = {};
32
- this.fileMappings.filter(f => f.enable).forEach(fileInfo => {
32
+ this.fileMappings.forEach(fileInfo => {
33
33
  const filePath = _path.default.join(this.tpFolder, fileInfo.filePath);
34
34
 
35
35
  if (_fs.default.existsSync(filePath)) {
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.optimizationConfig = optimizationConfig;
7
7
 
8
+ var _terserWebpackPlugin = _interopRequireDefault(require("terser-webpack-plugin"));
9
+
8
10
  var _nameTemplates = require("./common/nameTemplates");
9
11
 
10
12
  var _hashUtils = require("./custom_plugins/I18nSplitPlugin/utils/hashUtils");
@@ -13,6 +15,8 @@ var _configCSSMinifierPlugin = require("./pluginConfigs/configCSSMinifierPlugin"
13
15
 
14
16
  var _splitChunksConfig = require("./splitChunksConfig");
15
17
 
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
+
16
20
  function optimizationConfig(options) {
17
21
  const {
18
22
  changeRuntimeChunkChar
@@ -31,10 +35,16 @@ function optimizationConfig(options) {
31
35
  const suffix = // chunkSplitEnable ? '_[locale]' : '';
32
36
  chunkSplitEnable && chunkFilenameHasContentHash ? '_[locale]' : '';
33
37
  const char = changeRuntimeChunkChar;
38
+ const excludeList = options.optimization.jsExcludePath;
34
39
  return {
35
40
  splitChunks: (0, _splitChunksConfig.splitChunksConfig)(options),
36
41
  minimizer: [// For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
37
- '...', (0, _configCSSMinifierPlugin.configCSSMinifierPlugin)(options)].filter(Boolean),
42
+ // '...',
43
+ new _terserWebpackPlugin.default({
44
+ exclude: excludeList,
45
+ extractComments: false // Do not extract comments to .LICENSE.txt files
46
+
47
+ }), (0, _configCSSMinifierPlugin.configCSSMinifierPlugin)(options)].filter(Boolean),
38
48
  moduleIds: 'named',
39
49
  runtimeChunk: {
40
50
  name: entrypoint => `runtime${char}${entrypoint.name}${suffix}`
@@ -14,11 +14,15 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
14
14
  // import UglifyCSSPlugin from '../custom_plugins/UglifyCSSPlugin';
15
15
  // eslint-disable-next-line no-unused-vars
16
16
  function configCSSMinifierPlugin(options) {
17
+ const excludeList = options.optimization.cssExcludePath;
18
+
17
19
  if ((0, _modeUtils.isNotProduction)(options)) {
18
20
  return null;
19
21
  } // return null;
20
22
  // return new UglifyCSSPlugin();
21
23
 
22
24
 
23
- return new _cssMinimizerWebpackPlugin.default();
25
+ return new _cssMinimizerWebpackPlugin.default({
26
+ exclude: excludeList
27
+ });
24
28
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.6-exp.28",
3
+ "version": "0.0.6-exp.29",
4
4
  "description": "A CLI tool to build web applications and client libraries",
5
5
  "main": "lib/index.js",
6
6
  "bin": {