@zohodesk/client_build_tool 0.0.6-exp.30 → 0.0.6-exp.32

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.
@@ -277,7 +277,9 @@ var _default = {
277
277
  i18nTemplate: ''
278
278
  },
279
279
  manifestJson: {
280
- enable: false
280
+ enable: false,
281
+ i18nManifestJson: false,
282
+ licenseManifest: false
281
283
  },
282
284
  changeRuntimeChunkChar: '~',
283
285
  serviceWorker: {
@@ -22,7 +22,7 @@ function createManifestJson({
22
22
  if (option.needInitialEntries) {
23
23
  const initialFileNames = (0, _findInitialFileNames.findInitialFileNames)(compilation);
24
24
  const initialEntries = (0, _createInitialEntries.createInitialEntriesForManifestJson)(initialFileNames, hashDigestLength);
25
- manifestJson.initialEntries = initialEntries;
25
+ manifestJson.entryFiles = initialEntries;
26
26
  }
27
27
 
28
28
  const outputJson = (0, _addFilesNamesToManifestJson.addFilesNamesToManifestJson)({
@@ -40,10 +40,13 @@ function optimizationConfig(options) {
40
40
  splitChunks: (0, _splitChunksConfig.splitChunksConfig)(options),
41
41
  minimizer: [// For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
42
42
  // '...',
43
- new _terserWebpackPlugin.default({
43
+ excludeList !== '' ? new _terserWebpackPlugin.default({
44
44
  exclude: excludeList,
45
45
  extractComments: false // Do not extract comments to .LICENSE.txt files
46
46
 
47
+ }) : new _terserWebpackPlugin.default({
48
+ extractComments: false // Do not extract comments to .LICENSE.txt files
49
+
47
50
  }), (0, _configCSSMinifierPlugin.configCSSMinifierPlugin)(options)].filter(Boolean),
48
51
  moduleIds: 'named',
49
52
  runtimeChunk: {
@@ -22,7 +22,7 @@ function configCSSMinifierPlugin(options) {
22
22
  // return new UglifyCSSPlugin();
23
23
 
24
24
 
25
- return new _cssMinimizerWebpackPlugin.default({
25
+ return excludeList !== '' ? new _cssMinimizerWebpackPlugin.default({
26
26
  exclude: excludeList
27
- });
27
+ }) : new _cssMinimizerWebpackPlugin.default();
28
28
  }
@@ -9,24 +9,36 @@ var _ManifestJsonPlugin = require("../custom_plugins/ManifestJsonPlugin");
9
9
 
10
10
  function configManifestJsonPlugin(options) {
11
11
  const {
12
- manifestJson
13
- } = options;
12
+ enable,
13
+ i18nManifestJson,
14
+ licenseManifest
15
+ } = options.manifestJson;
14
16
 
15
- if (!manifestJson.enable) {
17
+ if (!enable) {
16
18
  return null;
17
19
  }
18
20
 
19
- return new _ManifestJsonPlugin.AddFileToManifestJson([{
21
+ const params = [{
20
22
  outputJsonFileName: 'manifest.json',
21
23
  test: f => !/\.i18n\.js$|\.LICENSE\.txt$|\.map$/.test(f),
22
24
  needInitialEntries: true
23
- }, {
24
- outputJsonFileName: 'i18nManifest.json',
25
- test: f => /\.i18n\.js$/g.test(f),
26
- needInitialEntries: false
27
- }, {
28
- outputJsonFileName: 'licenseManifest.json',
29
- test: f => /\.LICENSE\.txt$/g.test(f),
30
- needInitialEntries: false
31
- }]);
25
+ }];
26
+
27
+ if (i18nManifestJson) {
28
+ params.push({
29
+ outputJsonFileName: 'i18nManifest.json',
30
+ test: f => /\.i18n\.js$/g.test(f),
31
+ needInitialEntries: false
32
+ });
33
+ }
34
+
35
+ if (licenseManifest) {
36
+ params.push({
37
+ outputJsonFileName: 'licenseManifest.json',
38
+ test: f => /\.LICENSE\.txt$/g.test(f),
39
+ needInitialEntries: false
40
+ });
41
+ }
42
+
43
+ return new _ManifestJsonPlugin.AddFileToManifestJson(params);
32
44
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.6-exp.30",
3
+ "version": "0.0.6-exp.32",
4
4
  "description": "A CLI tool to build web applications and client libraries",
5
5
  "main": "lib/index.js",
6
6
  "bin": {