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

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.
@@ -320,6 +320,7 @@ var _default = {
320
320
  licenseManifest: false
321
321
  },
322
322
  changeRuntimeChunkChar: '~',
323
+ splitRuntimeChunk: true,
323
324
  serviceWorker: {
324
325
  enable: false,
325
326
  templateFilePath: 'sw.js',
@@ -120,6 +120,7 @@ var _default = {
120
120
  },
121
121
  app: {
122
122
  entryFile: 'src/index.js',
123
+ entryPointName: 'main',
123
124
  tpFolder: null,
124
125
  moduleResolvePath: 'node_modules'
125
126
  },
@@ -189,6 +190,7 @@ var _default = {
189
190
  enable: true
190
191
  },
191
192
  changeRuntimeChunkChar: '~',
193
+ splitRuntimeChunk: true,
192
194
  serviceWorker: {
193
195
  enable: false,
194
196
  templateFilePath: 'sw.js',
@@ -200,6 +202,9 @@ var _default = {
200
202
  fileName: null,
201
203
  options: null,
202
204
  excludeKeys: null
205
+ },
206
+ optimization: {
207
+ enable: true
203
208
  }
204
209
  };
205
210
  exports.default = _default;
@@ -6,5 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.configCustomLoaders = configCustomLoaders;
7
7
 
8
8
  function configCustomLoaders(options) {
9
- return options.customLoaders || [];
9
+ return {
10
+ test: /\.html$/,
11
+ type: 'asset/resource'
12
+ };
10
13
  }
@@ -15,10 +15,11 @@ function entryConfig(options) {
15
15
  } = options.efc;
16
16
  const {
17
17
  entryFile: mainEntry,
18
- AdditionalEntry
18
+ AdditionalEntry,
19
+ entryPointName: mainEntryPointName = 'main'
19
20
  } = options.app;
20
21
  const entry = {
21
- main: (0, _constants.joinWithAppPath)(mainEntry)
22
+ [mainEntryPointName]: (0, _constants.joinWithAppPath)(mainEntry)
22
23
  };
23
24
 
24
25
  if (hasEFC && entryFile) {
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.configHtmlFileLoader = configHtmlFileLoader;
7
6
  exports.configHtmlTemplateLoader = configHtmlTemplateLoader;
8
7
 
9
8
  function configHtmlTemplateLoader(options) {
@@ -16,11 +15,4 @@ function configHtmlTemplateLoader(options) {
16
15
  }
17
16
  }]
18
17
  };
19
- }
20
-
21
- function configHtmlFileLoader(options) {
22
- return {
23
- test: /\.html$/,
24
- type: 'asset/source'
25
- };
26
18
  }
@@ -18,6 +18,14 @@ 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
29
  const {
22
30
  changeRuntimeChunkChar
23
31
  } = options;
@@ -33,7 +33,7 @@ function configHtmlWebpackPlugin(options) {
33
33
  const minifyHtmlOptions = (0, _modeUtils.isProductionMode)(mode) ? // eslint-disable-next-line no-use-before-define
34
34
  getHTMLMinifyOptions(htmlTemplate) : false;
35
35
  return new _InitialHtmlPlugin.InitialHtmlPlugin({
36
- mainChunkName: 'main',
36
+ mainChunkName: options.app.entryPointName || 'main',
37
37
  filename: (0, _nameTemplates.nameTemplates)('html', options),
38
38
  template: appInitialHTMLTemplatePath,
39
39
  minify: minifyHtmlOptions,
@@ -25,7 +25,7 @@ function configI18nSplitPlugin(options) {
25
25
  const i18nPublicPath = (0, _resourceBasedPublicPath.resourceBasedPublicPath)('i18n', options); // const i18nPublicPathAsExpression = publicPathAsExpression('i18n', options);
26
26
 
27
27
  return new _I18nSplitPlugin.default({
28
- mainChunkName: 'main',
28
+ mainChunkName: options.app.entryPointName || 'main',
29
29
  jsResource: i18nChunkSplit.jsResource,
30
30
  localeVarName: i18nChunkSplit.localeVarName,
31
31
  jsonpFunc: i18nChunkSplit.jsonpFunc,
@@ -35,6 +35,6 @@ function configServiceWorkerPlugin(options) {
35
35
  i18nFileNameTemplate,
36
36
  chunkSplitEnable,
37
37
  enableRTLSplit,
38
- entryPointName: 'main'
38
+ entryPointName: options.app.entryPointName || 'main'
39
39
  });
40
40
  }
@@ -48,7 +48,7 @@ function webpackConfigCreator(options) {
48
48
  module: {
49
49
  /* strictExportPresence for break the build when imported module not present in respective file */
50
50
  // strictExportPresence: true,
51
- rules: [...(0, _jsLoaders.jsLoaders)(options), ...(0, _tsLoaders.tsLoaders)(options), ...(0, _cssLoaders.cssLoaders)(options), (0, _configWebWorkerLoader.configWebWorkerLoader)(options), (0, _configHtmlTemplateLoader.configHtmlTemplateLoader)(options), (0, _configHtmlTemplateLoader.configHtmlFileLoader)(options), ...(0, _assetLoaders.assetLoaders)(options), ...(0, _configCustomLoaders.configCustomLoaders)(options)]
51
+ rules: [...(0, _jsLoaders.jsLoaders)(options), ...(0, _tsLoaders.tsLoaders)(options), ...(0, _cssLoaders.cssLoaders)(options), (0, _configWebWorkerLoader.configWebWorkerLoader)(options), (0, _configHtmlTemplateLoader.configHtmlTemplateLoader)(options), ...(0, _assetLoaders.assetLoaders)(options), ...(0, _configCustomLoaders.configCustomLoaders)(options)]
52
52
  },
53
53
  plugins: (0, _plugins.plugins)(options),
54
54
  externals: (0, _externals.externals)(options),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/client_build_tool",
3
- "version": "0.0.22-exp.2",
3
+ "version": "0.0.22-exp.3",
4
4
  "description": "A CLI tool to build web applications and client libraries",
5
5
  "main": "lib/index.js",
6
6
  "bin": {