@zohodesk/client_build_tool 0.0.22-exp.3 → 0.0.22-exp.4

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.
@@ -214,7 +214,8 @@ var _default = {
214
214
  entryFile: {
215
215
  value: 'src/index.js',
216
216
  cli: 'entry'
217
- }
217
+ },
218
+ entryPointName: 'main'
218
219
  },
219
220
  resolve: {
220
221
  preferLocalFirst: false,
@@ -320,7 +321,6 @@ var _default = {
320
321
  licenseManifest: false
321
322
  },
322
323
  changeRuntimeChunkChar: '~',
323
- splitRuntimeChunk: true,
324
324
  serviceWorker: {
325
325
  enable: false,
326
326
  templateFilePath: 'sw.js',
@@ -374,6 +374,9 @@ var _default = {
374
374
  }
375
375
  },
376
376
  optimization: {
377
+ minimize: true,
378
+ splitChunks: true,
379
+ runtimeChunk: true,
377
380
  jsExcludePath: '',
378
381
  cssExcludePath: ''
379
382
  },
@@ -120,7 +120,6 @@ var _default = {
120
120
  },
121
121
  app: {
122
122
  entryFile: 'src/index.js',
123
- entryPointName: 'main',
124
123
  tpFolder: null,
125
124
  moduleResolvePath: 'node_modules'
126
125
  },
@@ -190,7 +189,6 @@ var _default = {
190
189
  enable: true
191
190
  },
192
191
  changeRuntimeChunkChar: '~',
193
- splitRuntimeChunk: true,
194
192
  serviceWorker: {
195
193
  enable: false,
196
194
  templateFilePath: 'sw.js',
@@ -202,9 +200,6 @@ var _default = {
202
200
  fileName: null,
203
201
  options: null,
204
202
  excludeKeys: null
205
- },
206
- optimization: {
207
- enable: true
208
203
  }
209
204
  };
210
205
  exports.default = _default;
@@ -6,8 +6,5 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.configCustomLoaders = configCustomLoaders;
7
7
 
8
8
  function configCustomLoaders(options) {
9
- return {
10
- test: /\.html$/,
11
- type: 'asset/resource'
12
- };
9
+ return options.customLoaders || [];
13
10
  }
@@ -18,14 +18,11 @@ var _splitChunksConfig = require("./splitChunksConfig");
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
20
20
  function optimizationConfig(options) {
21
- if (!options.optimization.enable) {
22
- return {
23
- minimize: false,
24
- splitChunks: false,
25
- runtimeChunk: false
26
- };
27
- }
28
-
21
+ const {
22
+ minimize,
23
+ splitChunks,
24
+ runtimeChunk
25
+ } = options.optimization;
29
26
  const {
30
27
  changeRuntimeChunkChar
31
28
  } = options;
@@ -45,8 +42,8 @@ function optimizationConfig(options) {
45
42
  const char = changeRuntimeChunkChar;
46
43
  const excludeList = options.optimization.jsExcludePath;
47
44
  return {
48
- splitChunks: (0, _splitChunksConfig.splitChunksConfig)(options),
49
- minimizer: [// For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
45
+ splitChunks: splitChunks ? (0, _splitChunksConfig.splitChunksConfig)(options) : false,
46
+ minimizer: minimize ? [// For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
50
47
  // '...',
51
48
  excludeList !== '' ? new _terserWebpackPlugin.default({
52
49
  exclude: excludeList,
@@ -55,10 +52,10 @@ function optimizationConfig(options) {
55
52
  }) : new _terserWebpackPlugin.default({
56
53
  extractComments: false // Do not extract comments to .LICENSE.txt files
57
54
 
58
- }), (0, _configCSSMinifierPlugin.configCSSMinifierPlugin)(options)].filter(Boolean),
55
+ }), (0, _configCSSMinifierPlugin.configCSSMinifierPlugin)(options)].filter(Boolean) : false,
59
56
  moduleIds: 'named',
60
- runtimeChunk: {
57
+ runtimeChunk: runtimeChunk ? {
61
58
  name: entrypoint => `runtime${char}${entrypoint.name}${suffix}`
62
- }
59
+ } : false
63
60
  };
64
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.22-exp.3",
3
+ "version": "0.0.22-exp.4",
4
4
  "description": "A CLI tool to build web applications and client libraries",
5
5
  "main": "lib/index.js",
6
6
  "bin": {