@zohodesk/react-cli 1.1.19-exp.3 → 1.1.19-exp.6

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 (166) hide show
  1. package/bin/cli.js +4 -0
  2. package/lib/babel/cmjs-plugins-presets.js +11 -6
  3. package/lib/babel/es-plugins-presets.js +12 -6
  4. package/lib/configs/webpack.dev.config.js +4 -0
  5. package/lib/configs/webpack.prod.config.js +5 -1
  6. package/lib/loaderUtils/getDevJsLoaders.js +1 -1
  7. package/lib/loaders/workerLoader.js +24 -39
  8. package/lib/pluginUtils/configHtmlWebpackPlugins.js +2 -9
  9. package/lib/pluginUtils/getDevPlugins.js +2 -4
  10. package/lib/pluginUtils/getProdPlugins.js +1 -3
  11. package/lib/schemas/index.js +4 -2
  12. package/npm-shrinkwrap.json +1076 -31
  13. package/package.json +6 -1
  14. package/packages/client_build_tool/lib/allCommandsConfigs.js +0 -23
  15. package/packages/client_build_tool/lib/buildToolLoggers.js +0 -32
  16. package/packages/client_build_tool/lib/commands/build/commandExecutor.js +0 -21
  17. package/packages/client_build_tool/lib/commands/build/config.js +0 -12
  18. package/packages/client_build_tool/lib/commands/build/errorHander.js +0 -10
  19. package/packages/client_build_tool/lib/commands/build/index.js +0 -35
  20. package/packages/client_build_tool/lib/commands/build/optionsProcesser.js +0 -40
  21. package/packages/client_build_tool/lib/commands/buildEs/commandExecutor.js +0 -17
  22. package/packages/client_build_tool/lib/commands/buildEs/config.js +0 -12
  23. package/packages/client_build_tool/lib/commands/buildLib/commandExecutor.js +0 -17
  24. package/packages/client_build_tool/lib/commands/buildLib/config.js +0 -12
  25. package/packages/client_build_tool/lib/commands/start/commandExecutor.js +0 -13
  26. package/packages/client_build_tool/lib/commands/start/config.js +0 -12
  27. package/packages/client_build_tool/lib/commands/start/deprecationHandler.js +0 -10
  28. package/packages/client_build_tool/lib/commands/start/errorHander.js +0 -10
  29. package/packages/client_build_tool/lib/commands/start/optionsProcesser.js +0 -36
  30. package/packages/client_build_tool/lib/commands/start/postProcesser.js +0 -10
  31. package/packages/client_build_tool/lib/commands/start/preProcesser.js +0 -10
  32. package/packages/client_build_tool/lib/commandsRouter.js +0 -71
  33. package/packages/client_build_tool/lib/shared/bundler/webpack/common/decidePublicPath.js +0 -44
  34. package/packages/client_build_tool/lib/shared/bundler/webpack/common/libAlias.js +0 -31
  35. package/packages/client_build_tool/lib/shared/bundler/webpack/common/nameTemplates.js +0 -51
  36. package/packages/client_build_tool/lib/shared/bundler/webpack/common/resourceBasedPublicPath.js +0 -21
  37. package/packages/client_build_tool/lib/shared/bundler/webpack/cssLoaders.js +0 -16
  38. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin.js +0 -111
  39. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/EFCPlugin.js +0 -1
  40. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ContributionGuide.md +0 -11
  41. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +0 -136
  42. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nSplit.md +0 -95
  43. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/README.md +0 -25
  44. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +0 -29
  45. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +0 -24
  46. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nDependency.js +0 -99
  47. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +0 -81
  48. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nModule.js +0 -201
  49. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +0 -401
  50. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +0 -67
  51. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +0 -23
  52. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +0 -29
  53. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +0 -49
  54. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +0 -77
  55. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +0 -63
  56. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +0 -19
  57. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +0 -31
  58. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +0 -127
  59. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RTLSplitPlugin.js +0 -1
  60. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +0 -63
  61. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +0 -89
  62. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtrSplit.md +0 -34
  63. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +0 -15
  64. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +0 -155
  65. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin.js +0 -49
  66. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_postcss_loaders/ExcludePlugin.js +0 -58
  67. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_postcss_loaders/RTLSplitPlugin.js +0 -139
  68. package/packages/client_build_tool/lib/shared/bundler/webpack/devServerConfig.js +0 -34
  69. package/packages/client_build_tool/lib/shared/bundler/webpack/getCSSLoaders.js +0 -30
  70. package/packages/client_build_tool/lib/shared/bundler/webpack/jsLoaders.js +0 -17
  71. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/assetLoaders.js +0 -14
  72. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +0 -24
  73. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +0 -18
  74. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +0 -21
  75. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +0 -138
  76. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +0 -83
  77. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +0 -23
  78. package/packages/client_build_tool/lib/shared/bundler/webpack/loaders/workerLoader.js +0 -133
  79. package/packages/client_build_tool/lib/shared/bundler/webpack/optimizationConfig.js +0 -39
  80. package/packages/client_build_tool/lib/shared/bundler/webpack/outputConfig.js +0 -28
  81. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +0 -18
  82. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCopyThirdpartyFile.js +0 -38
  83. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +0 -24
  84. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +0 -28
  85. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +0 -35
  86. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +0 -16
  87. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +0 -23
  88. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +0 -19
  89. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +0 -27
  90. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +0 -18
  91. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configUglifyCSSPlugin.js +0 -15
  92. package/packages/client_build_tool/lib/shared/bundler/webpack/plugins.js +0 -39
  93. package/packages/client_build_tool/lib/shared/bundler/webpack/postcssPlugins.js +0 -36
  94. package/packages/client_build_tool/lib/shared/bundler/webpack/resolvers.js +0 -42
  95. package/packages/client_build_tool/lib/shared/bundler/webpack/splitChunksConfig.js +0 -12
  96. package/packages/client_build_tool/lib/shared/bundler/webpack/webpack.dev.config.js +0 -17
  97. package/packages/client_build_tool/lib/shared/bundler/webpack/webpackBuild.js +0 -24
  98. package/packages/client_build_tool/lib/shared/bundler/webpack/webpackConfig.js +0 -50
  99. package/packages/client_build_tool/lib/shared/commands-utlis/doBasicRequiermentCheck.js +0 -16
  100. package/packages/client_build_tool/lib/shared/commands-utlis/getCliPath.js +0 -38
  101. package/packages/client_build_tool/lib/shared/commands-utlis/index.js +0 -29
  102. package/packages/client_build_tool/lib/shared/commands-utlis/log.js +0 -13
  103. package/packages/client_build_tool/lib/shared/commands-utlis/readArgsFormCommandLine.js +0 -11
  104. package/packages/client_build_tool/lib/shared/commands-utlis/readOptionFormCommandLine.js +0 -11
  105. package/packages/client_build_tool/lib/shared/commands-utlis/spanSync.js +0 -35
  106. package/packages/client_build_tool/lib/shared/constants.js +0 -33
  107. package/packages/client_build_tool/lib/shared/schemas/applyValuesToShema.js +0 -37
  108. package/packages/client_build_tool/lib/shared/schemas/cliArgsToObject.js +0 -37
  109. package/packages/client_build_tool/lib/shared/schemas/defaultConfigValues.js +0 -119
  110. package/packages/client_build_tool/lib/shared/schemas/deprecatedOptionsHandler.js +0 -65
  111. package/packages/client_build_tool/lib/shared/schemas/getCWD.js +0 -23
  112. package/packages/client_build_tool/lib/shared/schemas/getNpmVersion.js +0 -21
  113. package/packages/client_build_tool/lib/shared/schemas/npmConfigToObject.js +0 -32
  114. package/packages/client_build_tool/lib/shared/schemas/oldDefaultConfigValues.js +0 -480
  115. package/packages/client_build_tool/lib/shared/schemas/readOptions.js +0 -55
  116. package/packages/client_build_tool/lib/shared/schemas/readOptionsForPackageJson.js +0 -26
  117. package/packages/client_build_tool/lib/shared/schemas/readOptionsOld.js +0 -152
  118. package/packages/client_build_tool/lib/shared/server/cert/Tsicsezwild-22-23.crt +0 -37
  119. package/packages/client_build_tool/lib/shared/server/cert/Tsicsezwild-22-23.key +0 -27
  120. package/packages/client_build_tool/lib/shared/server/configWebpackDevMiddleware.js +0 -40
  121. package/packages/client_build_tool/lib/shared/server/corsHandleing.js +0 -28
  122. package/packages/client_build_tool/lib/shared/server/getIp.js +0 -30
  123. package/packages/client_build_tool/lib/shared/server/getServerURL.js +0 -29
  124. package/packages/client_build_tool/lib/shared/server/httpsOptions.js +0 -53
  125. package/packages/client_build_tool/lib/shared/server/initExpressApp.js +0 -19
  126. package/packages/client_build_tool/lib/shared/server/initialHTMLHandling.js +0 -66
  127. package/packages/client_build_tool/lib/shared/server/serveContextFiles.js +0 -24
  128. package/packages/client_build_tool/lib/shared/server/serverBywebpackDevMiddleware.js +0 -40
  129. package/packages/client_build_tool/lib/shared/server/startHttpServer.js +0 -26
  130. package/packages/client_build_tool/lib/shared/server/startHttpsServer.js +0 -34
  131. package/packages/client_build_tool/lib/shared/server/unwanted/addHttp2Server.js +0 -41
  132. package/packages/client_build_tool/lib/shared/server/unwanted/configWebpackDevMiddleware.js +0 -44
  133. package/packages/client_build_tool/lib/shared/server/unwanted/devServerUtlis.js +0 -1
  134. package/packages/client_build_tool/lib/shared/server/unwanted/mockApiSupport.js +0 -19
  135. package/packages/client_build_tool/lib/shared/server/unwanted/webpackConfig.js +0 -32
  136. package/packages/client_build_tool/lib/shared/server/unwanted/websocketMockSetup.js +0 -48
  137. package/packages/client_build_tool/lib/shared/server/urlConcat.js +0 -25
  138. package/packages/client_build_tool/lib/shared/utils/utils.js +0 -1
  139. package/packages/client_build_tool/node_modules/history/CHANGES.md +0 -395
  140. package/packages/client_build_tool/node_modules/history/DOMUtils.js +0 -3
  141. package/packages/client_build_tool/node_modules/history/ExecutionEnvironment.js +0 -3
  142. package/packages/client_build_tool/node_modules/history/LICENSE +0 -21
  143. package/packages/client_build_tool/node_modules/history/LocationUtils.js +0 -3
  144. package/packages/client_build_tool/node_modules/history/PathUtils.js +0 -3
  145. package/packages/client_build_tool/node_modules/history/README.md +0 -282
  146. package/packages/client_build_tool/node_modules/history/cjs/history.js +0 -933
  147. package/packages/client_build_tool/node_modules/history/cjs/history.min.js +0 -1
  148. package/packages/client_build_tool/node_modules/history/createBrowserHistory.js +0 -3
  149. package/packages/client_build_tool/node_modules/history/createHashHistory.js +0 -3
  150. package/packages/client_build_tool/node_modules/history/createMemoryHistory.js +0 -3
  151. package/packages/client_build_tool/node_modules/history/createTransitionManager.js +0 -3
  152. package/packages/client_build_tool/node_modules/history/es/DOMUtils.js +0 -7
  153. package/packages/client_build_tool/node_modules/history/es/ExecutionEnvironment.js +0 -7
  154. package/packages/client_build_tool/node_modules/history/es/LocationUtils.js +0 -7
  155. package/packages/client_build_tool/node_modules/history/es/PathUtils.js +0 -7
  156. package/packages/client_build_tool/node_modules/history/es/createBrowserHistory.js +0 -7
  157. package/packages/client_build_tool/node_modules/history/es/createHashHistory.js +0 -7
  158. package/packages/client_build_tool/node_modules/history/es/createMemoryHistory.js +0 -7
  159. package/packages/client_build_tool/node_modules/history/es/createTransitionManager.js +0 -7
  160. package/packages/client_build_tool/node_modules/history/es/warnAboutDeprecatedESMImport.js +0 -35
  161. package/packages/client_build_tool/node_modules/history/esm/history.js +0 -904
  162. package/packages/client_build_tool/node_modules/history/index.js +0 -7
  163. package/packages/client_build_tool/node_modules/history/package.json +0 -117
  164. package/packages/client_build_tool/node_modules/history/umd/history.js +0 -1059
  165. package/packages/client_build_tool/node_modules/history/umd/history.min.js +0 -1
  166. package/packages/client_build_tool/node_modules/history/warnAboutDeprecatedCJSRequire.js +0 -35
package/bin/cli.js CHANGED
@@ -300,6 +300,8 @@ switch (option) {
300
300
  'src',
301
301
  '-d',
302
302
  'lib',
303
+ '--extensions',
304
+ '.js,.ts,.tsx',
303
305
  `--presets=${require.resolve('../lib/babel/cmjs-plugins-presets.js')}`,
304
306
  '--copy-files'
305
307
  ].concat(args),
@@ -316,6 +318,8 @@ switch (option) {
316
318
  'src',
317
319
  '--out-dir',
318
320
  'es',
321
+ '--extensions',
322
+ '.js,.ts,.tsx',
319
323
  `--presets=${require.resolve('../lib/babel/es-plugins-presets.js')}`,
320
324
  '--copy-files'
321
325
  ].concat(args),
@@ -11,20 +11,25 @@ var _babelPresetReactOption = _interopRequireDefault(require("./babel-option-uti
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
- let {
14
+ const {
15
15
  module: {
16
16
  mode
17
+ },
18
+ babelCustomizationForLibrary: {
19
+ babelPlugins
17
20
  }
18
21
  } = (0, _utils.getOptions)();
19
- let isProd = mode.toLowerCase() === 'prod';
22
+ const isProd = mode.toLowerCase() === 'prod';
23
+ const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
24
+ __DOCS__: false
25
+ } : {}], require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('@babel/plugin-proposal-optional-chaining'), require.resolve('@babel/plugin-proposal-class-properties')];
26
+ const plugins = [...babelPlugins, ...defaultPlugins];
20
27
 
21
28
  var _default = () => ({
22
29
  presets: [require.resolve('@babel/preset-env'), (0, _babelPresetReactOption.default)({
23
30
  disableES5Transpile: false
24
- })],
25
- plugins: [[require.resolve('babel-plugin-transform-define'), isProd ? {
26
- __DOCS__: false
27
- } : {}]]
31
+ }), require.resolve('@babel/preset-typescript')],
32
+ plugins: plugins
28
33
  });
29
34
 
30
35
  exports.default = _default;
@@ -11,13 +11,21 @@ var _babelPresetReactOption = _interopRequireDefault(require("./babel-option-uti
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
- let {
14
+ const {
15
15
  module: {
16
16
  mode,
17
17
  disableES5Transpile
18
+ },
19
+ babelCustomizationForLibrary: {
20
+ babelPlugins
18
21
  }
19
22
  } = (0, _utils.getOptions)();
20
- let isProd = mode.toLowerCase() === 'prod';
23
+ const isProd = mode.toLowerCase() === 'prod';
24
+ const defaultPlugins = [[require.resolve('babel-plugin-transform-define'), isProd ? {
25
+ __DOCS__: false
26
+ } : {}], require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('@babel/plugin-proposal-optional-chaining'), require.resolve('@babel/plugin-proposal-class-properties')];
27
+ const plugins = [...babelPlugins, ...defaultPlugins];
28
+ console.log(disableES5Transpile);
21
29
 
22
30
  var _default = () => ({
23
31
  presets: [[require.resolve('@babel/preset-env'), disableES5Transpile ? {
@@ -31,10 +39,8 @@ var _default = () => ({
31
39
  modules: false
32
40
  }], (0, _babelPresetReactOption.default)({
33
41
  disableES5Transpile
34
- })],
35
- plugins: [[require.resolve('babel-plugin-transform-define'), isProd ? {
36
- __DOCS__: false
37
- } : {}], require.resolve('@babel/plugin-syntax-dynamic-import')]
42
+ }), require.resolve('@babel/preset-typescript')],
43
+ plugins: plugins
38
44
  });
39
45
 
40
46
  exports.default = _default;
@@ -146,6 +146,10 @@ module.exports = {
146
146
  minimize: true
147
147
  }
148
148
  }]
149
+ }, {
150
+ test: /\.ts$/,
151
+ use: 'ts-loader',
152
+ include: _path.default.join(appPath, folder)
149
153
  }, {
150
154
  test: /\.worker.js$/,
151
155
  use: {
@@ -131,7 +131,7 @@ module.exports = {
131
131
  modules: false
132
132
  }], (0, _babelPresetReactOption.default)({
133
133
  disableES5Transpile
134
- })],
134
+ }), require.resolve('@babel/preset-typescript')],
135
135
  plugins: disableES5Transpile ? [removeAttribute ? require.resolve('../utils/removeAttributes') : false, require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('babel-plugin-lodash'), // require.resolve(
136
136
  // '@babel/plugin-proposal-object-rest-spread'
137
137
  // ), REMOVING IT, BECAUSE WE ALREADY SUPPORT SPREAD SYNTAX FROM LIBRARIES.
@@ -237,6 +237,10 @@ module.exports = {
237
237
  minimize: false
238
238
  }
239
239
  }]
240
+ }, {
241
+ test: /\.ts$/,
242
+ use: 'ts-loader',
243
+ include: _path.default.join(appPath, folder)
240
244
  }, {
241
245
  test: /\.worker.js$/,
242
246
  use: {
@@ -44,7 +44,7 @@ let getDevJsLoaders = options => {
44
44
  modules: false
45
45
  }], (0, _babelPresetReactOption.default)({
46
46
  disableES5Transpile
47
- })],
47
+ }), require.resolve('@babel/preset-typescript')],
48
48
  plugins: disableES5Transpile ? [require.resolve('@babel/plugin-syntax-dynamic-import'), require.resolve('babel-plugin-lodash'), // require.resolve('@babel/plugin-proposal-object-rest-spread'),
49
49
  devConsoleExculde ? [require.resolve('babel-plugin-transform-remove-console'), {
50
50
  exclude: ['error', 'log']
@@ -19,32 +19,32 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
19
19
  /* import WebWorkerTemplatePlugin from 'webpack/lib/webworker/WebWorkerTemplatePlugin';
20
20
  import ExternalsPlugin from 'webpack/lib/ExternalsPlugin'; */
21
21
  const schema = {
22
- type: 'object',
23
- properties: {
24
- publicPath: {
25
- anyOf: [{
26
- type: 'string'
22
+ 'type': 'object',
23
+ 'properties': {
24
+ 'publicPath': {
25
+ 'anyOf': [{
26
+ 'type': 'string'
27
27
  }, {
28
- instanceof: 'Function'
28
+ 'instanceof': 'Function'
29
29
  }]
30
30
  },
31
- filename: {
32
- anyOf: [{
33
- type: 'string',
34
- minLength: 1
31
+ 'filename': {
32
+ 'anyOf': [{
33
+ 'type': 'string',
34
+ 'minLength': 1
35
35
  }, {
36
- instanceof: 'Function'
36
+ 'instanceof': 'Function'
37
37
  }]
38
38
  },
39
- chunkFilename: {
40
- type: 'string',
41
- minLength: 1
39
+ 'chunkFilename': {
40
+ 'type': 'string',
41
+ 'minLength': 1
42
42
  },
43
- esModule: {
44
- type: 'boolean'
43
+ 'esModule': {
44
+ 'type': 'boolean'
45
45
  }
46
46
  },
47
- additionalProperties: false
47
+ 'additionalProperties': false
48
48
  }; // eslint-disable-next-line
49
49
 
50
50
  function loader() {}
@@ -112,40 +112,25 @@ function pitch(request) {
112
112
  }
113
113
 
114
114
  function workerCode() {
115
- if (this.workerInstance) {
116
- return this.workerInstance;
117
- }
118
-
119
115
  let blob;
120
116
 
121
117
  try {
122
118
  blob = new Blob([`importScripts('${this.workerUrl}');`], {
123
- type: 'application/javascript'
119
+ 'type': 'application/javascript'
124
120
  });
125
121
  } catch (e1) {
126
122
  throw new Error(e1);
127
123
  }
128
124
 
129
- const url = window.URL || window.webkitURL;
130
- const blobUrl = url.createObjectURL(blob);
131
- this.workerInstance = new Worker(blobUrl);
132
- return this.workerInstance;
125
+ let url = window.URL || window.webkitURL;
126
+ let blobUrl = url.createObjectURL(blob);
127
+ let worker = new Worker(blobUrl);
128
+ return worker;
133
129
  }
134
130
 
135
- return cb(null, `const workerObj ={\n
136
- workerInstance: null, \n
131
+ return cb(null, `${options.esModule ? 'export default' : 'module.exports ='} {\n
137
132
  workerUrl: __webpack_public_path__ + ${JSON.stringify(entry)}, \n
138
133
  getInstance: ${workerCode} \n
139
- };\n
140
- workerObj.getInstance();
141
- ${options.esModule ? 'export default' : 'module.exports ='} workerObj;
142
- `); // return cb(
143
- // null,
144
- // `${options.esModule ? 'export default' : 'module.exports ='} {\n
145
- // workerInstance: null, \n
146
- // workerUrl: __webpack_public_path__ + ${JSON.stringify(entry)}, \n
147
- // getInstance: ${workerCode} \n
148
- // }`
149
- // );
134
+ }`);
150
135
  });
151
136
  }
@@ -26,12 +26,6 @@ const defaultHTMLMiniFyOption = {
26
26
  removeStyleLinkTypeAttributes: true,
27
27
  useShortDoctype: true
28
28
  };
29
- const defaultScriptLoadingStrategy = 'defer';
30
-
31
- function getScriptLoadingStrategy(scriptLoadingStategey) {
32
- const allowedScriptLoadingStrategies = ['blocking', 'defer'];
33
- return allowedScriptLoadingStrategies.includes(scriptLoadingStategey) ? scriptLoadingStategey : defaultScriptLoadingStrategy;
34
- }
35
29
 
36
30
  function configHtmlWebpackPlugins(plugins, {
37
31
  enableChunkHash = false,
@@ -39,8 +33,7 @@ function configHtmlWebpackPlugins(plugins, {
39
33
  inject,
40
34
  crossorigin,
41
35
  hasEFC,
42
- minify: minifyHtmlOptions = false,
43
- scriptLoadingStrategey
36
+ minify: minifyHtmlOptions = false
44
37
  }) {
45
38
  const optionsHtmlWebpack = {
46
39
  chunksSortMode: 'none',
@@ -51,7 +44,7 @@ function configHtmlWebpackPlugins(plugins, {
51
44
  // ? minifyHtmlOptions
52
45
  // : minifyHtmlOptions,,
53
46
  templateParameters: _common.templateParameters,
54
- scriptLoading: getScriptLoadingStrategy(scriptLoadingStrategey),
47
+ scriptLoading: 'defer',
55
48
  inject: inject
56
49
  };
57
50
 
@@ -60,8 +60,7 @@ const getDevPlugins = (options, publicPath) => {
60
60
  mode
61
61
  },
62
62
  htmlTemplate: {
63
- inject,
64
- scriptLoadingStrategey
63
+ inject
65
64
  },
66
65
  crossorigin
67
66
  },
@@ -167,8 +166,7 @@ const getDevPlugins = (options, publicPath) => {
167
166
  minify: false,
168
167
  inject,
169
168
  crossorigin,
170
- hasEFC,
171
- scriptLoadingStrategey
169
+ hasEFC
172
170
  });
173
171
 
174
172
  if (hasEFC) {
@@ -78,8 +78,7 @@ const getProdPlugins = (options, publicPath = '') => {
78
78
  } = options.app;
79
79
  const {
80
80
  inject,
81
- minify: minifyHtmlOptions,
82
- scriptLoadingStrategey
81
+ minify: minifyHtmlOptions
83
82
  } = htmlTemplate;
84
83
  const {
85
84
  i18n
@@ -177,7 +176,6 @@ const getProdPlugins = (options, publicPath = '') => {
177
176
  folder,
178
177
  inject,
179
178
  minify: minifyHtmlOptions,
180
- scriptLoadingStrategey,
181
179
  crossorigin,
182
180
  hasEFC
183
181
  });
@@ -322,8 +322,7 @@ var _default = {
322
322
  },
323
323
  htmlTemplate: {
324
324
  minify: null,
325
- inject: true,
326
- scriptLoadingStrategey: ''
325
+ inject: true
327
326
  },
328
327
  removePropTypes: false,
329
328
  customChunksBaseConfig: null,
@@ -739,6 +738,9 @@ var _default = {
739
738
  fileName: null,
740
739
  options: null,
741
740
  excludeKeys: null
741
+ },
742
+ babelCustomizationForLibrary: {
743
+ babelPlugins: []
742
744
  }
743
745
  };
744
746
  exports.default = _default;