@zohodesk/react-cli 1.1.19-exp.1 → 1.1.19-exp.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) 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/jest.config.js +3 -3
  5. package/lib/configs/webpack.dev.config.js +4 -0
  6. package/lib/configs/webpack.prod.config.js +5 -1
  7. package/lib/jest/preProcessors/jsPreprocessor.js +1 -1
  8. package/lib/loaderUtils/getDevJsLoaders.js +1 -1
  9. package/lib/loaders/workerLoader.js +24 -39
  10. package/lib/schemas/index.js +3 -0
  11. package/npm-shrinkwrap.json +445 -19077
  12. package/package.json +6 -1
  13. package/packages/client_build_tool/lib/allCommandsConfigs.js +0 -23
  14. package/packages/client_build_tool/lib/buildToolLoggers.js +0 -32
  15. package/packages/client_build_tool/lib/commands/build/commandExecutor.js +0 -21
  16. package/packages/client_build_tool/lib/commands/build/config.js +0 -12
  17. package/packages/client_build_tool/lib/commands/build/errorHander.js +0 -10
  18. package/packages/client_build_tool/lib/commands/build/index.js +0 -35
  19. package/packages/client_build_tool/lib/commands/build/optionsProcesser.js +0 -40
  20. package/packages/client_build_tool/lib/commands/buildEs/commandExecutor.js +0 -17
  21. package/packages/client_build_tool/lib/commands/buildEs/config.js +0 -12
  22. package/packages/client_build_tool/lib/commands/buildLib/commandExecutor.js +0 -17
  23. package/packages/client_build_tool/lib/commands/buildLib/config.js +0 -12
  24. package/packages/client_build_tool/lib/commands/start/commandExecutor.js +0 -13
  25. package/packages/client_build_tool/lib/commands/start/config.js +0 -12
  26. package/packages/client_build_tool/lib/commands/start/deprecationHandler.js +0 -10
  27. package/packages/client_build_tool/lib/commands/start/errorHander.js +0 -10
  28. package/packages/client_build_tool/lib/commands/start/optionsProcesser.js +0 -36
  29. package/packages/client_build_tool/lib/commands/start/postProcesser.js +0 -10
  30. package/packages/client_build_tool/lib/commands/start/preProcesser.js +0 -10
  31. package/packages/client_build_tool/lib/commandsRouter.js +0 -71
  32. package/packages/client_build_tool/lib/shared/bundler/webpack/common/decidePublicPath.js +0 -44
  33. package/packages/client_build_tool/lib/shared/bundler/webpack/common/libAlias.js +0 -31
  34. package/packages/client_build_tool/lib/shared/bundler/webpack/common/nameTemplates.js +0 -51
  35. package/packages/client_build_tool/lib/shared/bundler/webpack/common/resourceBasedPublicPath.js +0 -21
  36. package/packages/client_build_tool/lib/shared/bundler/webpack/cssLoaders.js +0 -16
  37. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/CdnChangePlugin.js +0 -111
  38. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/EFCPlugin.js +0 -1
  39. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/ContributionGuide.md +0 -11
  40. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nKeysIdentifer.js +0 -136
  41. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/I18nSplit.md +0 -95
  42. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/README.md +0 -25
  43. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/constants.js +0 -29
  44. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/createHash.js +0 -24
  45. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nDependency.js +0 -99
  46. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nLoadingRuntimeModule.js +0 -81
  47. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/getI18nModule.js +0 -201
  48. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/index.js +0 -401
  49. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/optionsHandler.js +0 -67
  50. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/pathCreator.js +0 -23
  51. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/readI18nValues.js +0 -29
  52. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateFileName.js +0 -49
  53. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/templateHashHelpers.js +0 -77
  54. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/collectI18nKeys.js +0 -63
  55. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/hashUtils.js +0 -19
  56. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/index.js +0 -31
  57. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/I18nSplitPlugin/utils/propertiesUtils.js +0 -127
  58. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RTLSplitPlugin.js +0 -1
  59. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/OverwriteCssPathForRTL.js +0 -63
  60. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtlCssPlugin.js +0 -89
  61. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/RtrSplit.md +0 -34
  62. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/RtlSplitPlugin/replaceCssDirTemplate.js +0 -15
  63. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/ServiceWorkerPlugin.js +0 -155
  64. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_plugins/UglifyCSSPlugin.js +0 -49
  65. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_postcss_loaders/ExcludePlugin.js +0 -58
  66. package/packages/client_build_tool/lib/shared/bundler/webpack/custom_postcss_loaders/RTLSplitPlugin.js +0 -139
  67. package/packages/client_build_tool/lib/shared/bundler/webpack/devServerConfig.js +0 -34
  68. package/packages/client_build_tool/lib/shared/bundler/webpack/getCSSLoaders.js +0 -30
  69. package/packages/client_build_tool/lib/shared/bundler/webpack/jsLoaders.js +0 -17
  70. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/assetLoaders.js +0 -14
  71. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/babelLoaderConfig.js +0 -24
  72. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configHtmlTemplateLoader.js +0 -18
  73. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configWebWorkerLoader.js +0 -21
  74. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/configsAssetsLoaders.js +0 -138
  75. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/cssClassNameGenerate.js +0 -83
  76. package/packages/client_build_tool/lib/shared/bundler/webpack/loaderConfigs/getCssLoaderOptions.js +0 -23
  77. package/packages/client_build_tool/lib/shared/bundler/webpack/loaders/workerLoader.js +0 -133
  78. package/packages/client_build_tool/lib/shared/bundler/webpack/optimizationConfig.js +0 -39
  79. package/packages/client_build_tool/lib/shared/bundler/webpack/outputConfig.js +0 -28
  80. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCdnChangePlugin.js +0 -18
  81. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configCopyThirdpartyFile.js +0 -38
  82. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configEnvVariables.js +0 -24
  83. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configHtmlWebpackPlugin.js +0 -28
  84. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configI18nSplitPlugin.js +0 -35
  85. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configIgnorePlugin.js +0 -16
  86. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configMiniCSSExtractPlugin.js +0 -23
  87. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configProgressPlugin.js +0 -19
  88. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configRtlCssPlugin.js +0 -27
  89. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configServiceWorkerPlugin.js +0 -18
  90. package/packages/client_build_tool/lib/shared/bundler/webpack/pluginConfigs/configUglifyCSSPlugin.js +0 -15
  91. package/packages/client_build_tool/lib/shared/bundler/webpack/plugins.js +0 -39
  92. package/packages/client_build_tool/lib/shared/bundler/webpack/postcssPlugins.js +0 -36
  93. package/packages/client_build_tool/lib/shared/bundler/webpack/resolvers.js +0 -42
  94. package/packages/client_build_tool/lib/shared/bundler/webpack/splitChunksConfig.js +0 -12
  95. package/packages/client_build_tool/lib/shared/bundler/webpack/webpack.dev.config.js +0 -17
  96. package/packages/client_build_tool/lib/shared/bundler/webpack/webpackBuild.js +0 -24
  97. package/packages/client_build_tool/lib/shared/bundler/webpack/webpackConfig.js +0 -50
  98. package/packages/client_build_tool/lib/shared/commands-utlis/doBasicRequiermentCheck.js +0 -16
  99. package/packages/client_build_tool/lib/shared/commands-utlis/getCliPath.js +0 -38
  100. package/packages/client_build_tool/lib/shared/commands-utlis/index.js +0 -29
  101. package/packages/client_build_tool/lib/shared/commands-utlis/log.js +0 -13
  102. package/packages/client_build_tool/lib/shared/commands-utlis/readArgsFormCommandLine.js +0 -11
  103. package/packages/client_build_tool/lib/shared/commands-utlis/readOptionFormCommandLine.js +0 -11
  104. package/packages/client_build_tool/lib/shared/commands-utlis/spanSync.js +0 -35
  105. package/packages/client_build_tool/lib/shared/constants.js +0 -33
  106. package/packages/client_build_tool/lib/shared/schemas/applyValuesToShema.js +0 -37
  107. package/packages/client_build_tool/lib/shared/schemas/cliArgsToObject.js +0 -37
  108. package/packages/client_build_tool/lib/shared/schemas/defaultConfigValues.js +0 -119
  109. package/packages/client_build_tool/lib/shared/schemas/deprecatedOptionsHandler.js +0 -65
  110. package/packages/client_build_tool/lib/shared/schemas/getCWD.js +0 -23
  111. package/packages/client_build_tool/lib/shared/schemas/getNpmVersion.js +0 -21
  112. package/packages/client_build_tool/lib/shared/schemas/npmConfigToObject.js +0 -32
  113. package/packages/client_build_tool/lib/shared/schemas/oldDefaultConfigValues.js +0 -480
  114. package/packages/client_build_tool/lib/shared/schemas/readOptions.js +0 -55
  115. package/packages/client_build_tool/lib/shared/schemas/readOptionsForPackageJson.js +0 -26
  116. package/packages/client_build_tool/lib/shared/schemas/readOptionsOld.js +0 -152
  117. package/packages/client_build_tool/lib/shared/server/cert/Tsicsezwild-22-23.crt +0 -37
  118. package/packages/client_build_tool/lib/shared/server/cert/Tsicsezwild-22-23.key +0 -27
  119. package/packages/client_build_tool/lib/shared/server/configWebpackDevMiddleware.js +0 -40
  120. package/packages/client_build_tool/lib/shared/server/corsHandleing.js +0 -28
  121. package/packages/client_build_tool/lib/shared/server/getIp.js +0 -30
  122. package/packages/client_build_tool/lib/shared/server/getServerURL.js +0 -29
  123. package/packages/client_build_tool/lib/shared/server/httpsOptions.js +0 -53
  124. package/packages/client_build_tool/lib/shared/server/initExpressApp.js +0 -19
  125. package/packages/client_build_tool/lib/shared/server/initialHTMLHandling.js +0 -66
  126. package/packages/client_build_tool/lib/shared/server/serveContextFiles.js +0 -24
  127. package/packages/client_build_tool/lib/shared/server/serverBywebpackDevMiddleware.js +0 -40
  128. package/packages/client_build_tool/lib/shared/server/startHttpServer.js +0 -26
  129. package/packages/client_build_tool/lib/shared/server/startHttpsServer.js +0 -34
  130. package/packages/client_build_tool/lib/shared/server/unwanted/addHttp2Server.js +0 -41
  131. package/packages/client_build_tool/lib/shared/server/unwanted/configWebpackDevMiddleware.js +0 -44
  132. package/packages/client_build_tool/lib/shared/server/unwanted/devServerUtlis.js +0 -1
  133. package/packages/client_build_tool/lib/shared/server/unwanted/mockApiSupport.js +0 -19
  134. package/packages/client_build_tool/lib/shared/server/unwanted/webpackConfig.js +0 -32
  135. package/packages/client_build_tool/lib/shared/server/unwanted/websocketMockSetup.js +0 -48
  136. package/packages/client_build_tool/lib/shared/server/urlConcat.js +0 -25
  137. package/packages/client_build_tool/lib/shared/utils/utils.js +0 -1
  138. package/packages/client_build_tool/node_modules/history/CHANGES.md +0 -395
  139. package/packages/client_build_tool/node_modules/history/DOMUtils.js +0 -3
  140. package/packages/client_build_tool/node_modules/history/ExecutionEnvironment.js +0 -3
  141. package/packages/client_build_tool/node_modules/history/LICENSE +0 -21
  142. package/packages/client_build_tool/node_modules/history/LocationUtils.js +0 -3
  143. package/packages/client_build_tool/node_modules/history/PathUtils.js +0 -3
  144. package/packages/client_build_tool/node_modules/history/README.md +0 -282
  145. package/packages/client_build_tool/node_modules/history/cjs/history.js +0 -933
  146. package/packages/client_build_tool/node_modules/history/cjs/history.min.js +0 -1
  147. package/packages/client_build_tool/node_modules/history/createBrowserHistory.js +0 -3
  148. package/packages/client_build_tool/node_modules/history/createHashHistory.js +0 -3
  149. package/packages/client_build_tool/node_modules/history/createMemoryHistory.js +0 -3
  150. package/packages/client_build_tool/node_modules/history/createTransitionManager.js +0 -3
  151. package/packages/client_build_tool/node_modules/history/es/DOMUtils.js +0 -7
  152. package/packages/client_build_tool/node_modules/history/es/ExecutionEnvironment.js +0 -7
  153. package/packages/client_build_tool/node_modules/history/es/LocationUtils.js +0 -7
  154. package/packages/client_build_tool/node_modules/history/es/PathUtils.js +0 -7
  155. package/packages/client_build_tool/node_modules/history/es/createBrowserHistory.js +0 -7
  156. package/packages/client_build_tool/node_modules/history/es/createHashHistory.js +0 -7
  157. package/packages/client_build_tool/node_modules/history/es/createMemoryHistory.js +0 -7
  158. package/packages/client_build_tool/node_modules/history/es/createTransitionManager.js +0 -7
  159. package/packages/client_build_tool/node_modules/history/es/warnAboutDeprecatedESMImport.js +0 -35
  160. package/packages/client_build_tool/node_modules/history/esm/history.js +0 -904
  161. package/packages/client_build_tool/node_modules/history/index.js +0 -7
  162. package/packages/client_build_tool/node_modules/history/package.json +0 -117
  163. package/packages/client_build_tool/node_modules/history/umd/history.js +0 -1059
  164. package/packages/client_build_tool/node_modules/history/umd/history.min.js +0 -1
  165. package/packages/client_build_tool/node_modules/history/warnAboutDeprecatedCJSRequire.js +0 -35
@@ -1,138 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.configAudioLoader = configAudioLoader;
7
- exports.configFontLoader = configFontLoader;
8
- exports.configImageLoader = configImageLoader;
9
- exports.configSVGLoader = configSVGLoader;
10
- exports.configVideoLoader = configVideoLoader;
11
-
12
- var _nameTemplates = require("../common/nameTemplates");
13
-
14
- // function getLoaderOptionQueryString(params) {
15
- const ImageExtRegex = /\.jpe?g$|\.gif$|\.png|\.webp$/;
16
- const FontExtRegex = /\.woff2|\.woff$|\.ttf$|\.eot$/;
17
- const SVGExtRegex = /\.svg$/;
18
- const AudioExtRegex = /\.ogg$/;
19
- const VideoExtRegex = /\.mp4|\.webm$/;
20
-
21
- function createAssetLoader({
22
- test,
23
- nameTemplate,
24
- limit
25
- }) {
26
- const conf = {
27
- test,
28
- type: 'asset'
29
- };
30
-
31
- if (limit) {
32
- conf.parser = {
33
- dataUrlCondition: {
34
- maxSize: limit // 4 * 1024 // 4kb
35
-
36
- }
37
- };
38
- } else {
39
- conf.type = 'asset/resource';
40
- }
41
-
42
- if (nameTemplate) {
43
- conf.generator = {
44
- filename: nameTemplate
45
- };
46
- }
47
-
48
- return conf;
49
- }
50
- /**
51
- * @typedef {Object} LoaderConfig
52
- * @property {Number} enableChunkHash
53
- */
54
-
55
- /**
56
- * @param {LoaderConfig} options
57
- * @returns
58
- */
59
-
60
-
61
- function configImageLoader(options) {
62
- return createAssetLoader({
63
- test: ImageExtRegex,
64
- nameTemplate: (0, _nameTemplates.nameTemplates)('image', options),
65
- limit: 1000
66
- });
67
- }
68
-
69
- function configFontLoader(options) {
70
- return createAssetLoader({
71
- test: FontExtRegex,
72
- nameTemplate: (0, _nameTemplates.nameTemplates)('font', options),
73
- limit: 1000
74
- });
75
- }
76
-
77
- function configSVGLoader(options) {
78
- return createAssetLoader({
79
- test: SVGExtRegex,
80
- nameTemplate: (0, _nameTemplates.nameTemplates)('svg', options),
81
- limit: 1000
82
- });
83
- }
84
-
85
- function configAudioLoader(options) {
86
- return createAssetLoader({
87
- test: AudioExtRegex,
88
- nameTemplate: (0, _nameTemplates.nameTemplates)('audio', options)
89
- });
90
- }
91
-
92
- function configVideoLoader(options) {
93
- return createAssetLoader({
94
- test: VideoExtRegex,
95
- nameTemplate: (0, _nameTemplates.nameTemplates)('video', options)
96
- });
97
- }
98
- /*
99
- export function createNameTemplate(enableChunkHash) {
100
- const ext = `${enableChunkHash ? ".[hash:20]" : ""}.[ext]`;
101
- return `[name]${ext}`;
102
- }
103
-
104
- export function createImageAndFontsAndSVGLoaders(enableChunkHash) {
105
- const nameTemplate = createNameTemplate(enableChunkHash);
106
- return [
107
- configImageLoader(nameTemplate),
108
- configFontLoader(nameTemplate),
109
- configSVGLoader(nameTemplate),
110
- configAudioLoader(nameTemplate)
111
- ];
112
- }
113
- */
114
-
115
- /*
116
- export function createLoaderOptionObject(
117
- loaderName,
118
- nameTemplate,
119
- fallback,
120
- limit = 1000
121
- ) {
122
- return {
123
- loader: loaderName,
124
- options: {
125
- limit,
126
- name: nameTemplate,
127
- fallback
128
- }
129
- };
130
- }
131
-
132
- function configLoaderObject(filter, loaderAndOptions) {
133
- return {
134
- test: filter,
135
- use: loaderAndOptions
136
- };
137
- }
138
- */
@@ -1,83 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _crypto = require("crypto");
9
-
10
- var _os = _interopRequireDefault(require("os"));
11
-
12
- var _path = _interopRequireDefault(require("path"));
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function getHash(str) {
17
- return (0, _crypto.createHash)('md5').update(str).digest();
18
- }
19
-
20
- const isWindows = _os.default.platform().toLowerCase() === 'win32';
21
-
22
- const isFileEligibleToHashClass = (resourcePath, machineBasedPatterns) => {
23
- if (!resourcePath.includes('node_modules')) {
24
- return false;
25
- }
26
-
27
- return machineBasedPatterns.some(p => resourcePath.includes(p));
28
- };
29
-
30
- var _default = options => {
31
- const {
32
- classNameOptions
33
- } = options.css;
34
- const {
35
- cssHashSelectors,
36
- classNamePrefix
37
- } = classNameOptions;
38
- let canApplyHashClassName = null;
39
-
40
- if (cssHashSelectors) {
41
- const {
42
- filenames,
43
- packages
44
- } = cssHashSelectors;
45
- const machineBasedPatterns = isWindows ? packages.map(e => e.replace(/\//g, '\\')) : packages;
46
-
47
- canApplyHashClassName = function canApplyHashClassName(resourcePath, cleanFileName) {
48
- return isFileEligibleToHashClass(resourcePath, machineBasedPatterns) || filenames.indexOf(cleanFileName);
49
- };
50
- }
51
-
52
- return (context, localIdentName, localName) => {
53
- // NOTE: in build macine we use date as folder path.
54
- // So every time we create new build there is path will alway different
55
- // in order to minmaze that problem we try in relative path;
56
- // console.log('context.resourcePath', context.resourcePath, context);
57
- // let contextResourcePath = context.resourcePath;
58
- const {
59
- rootContext,
60
- resourcePath
61
- } = context;
62
-
63
- const relativePath = _path.default.relative(rootContext, resourcePath);
64
-
65
- if (resourcePath.endsWith('.plain.css')) {
66
- return localName;
67
- }
68
-
69
- const fileNameWithoutExt = _path.default.parse(relativePath).name;
70
-
71
- const cleanFileName = fileNameWithoutExt.replace(/-/g, '_').toLowerCase(); // css file has casesensitive selector issue so can't toLowerCase
72
- // let local = localName.toLowerCase()
73
-
74
- if (canApplyHashClassName && canApplyHashClassName(resourcePath, cleanFileName)) {
75
- const h = getHash(`${relativePath}-${localName}`, 10);
76
- return `${classNamePrefix}${h}`;
77
- }
78
-
79
- return `${classNamePrefix}-${cleanFileName}-${localName}`;
80
- };
81
- };
82
-
83
- exports.default = _default;
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getCssLoaderOptions = getCssLoaderOptions;
7
-
8
- var _cssClassNameGenerate = _interopRequireDefault(require("./cssClassNameGenerate"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
- function getCssLoaderOptions(options) {
13
- // const { classNameOptions } = options.css;
14
- const cssLoaderOptions = {
15
- importLoaders: 1,
16
- modules: {
17
- // localIdentName: classNameOptions.classNameBlob,
18
- getLocalIdent: (0, _cssClassNameGenerate.default)(options)
19
- },
20
- sourceMap: true
21
- };
22
- return cssLoaderOptions;
23
- }
@@ -1,133 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = loader;
7
- exports.pitch = pitch;
8
-
9
- var _path = _interopRequireDefault(require("path"));
10
-
11
- var _SingleEntryPlugin = _interopRequireDefault(require("webpack/lib/SingleEntryPlugin"));
12
-
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
-
15
- // import { getOptions } from 'loader-utils';
16
- // import validateOptions from 'schema-utils';
17
- const schema = {
18
- 'type': 'object',
19
- 'properties': {
20
- 'publicPath': {
21
- 'anyOf': [{
22
- 'type': 'string'
23
- }, {
24
- 'instanceof': 'Function'
25
- }]
26
- },
27
- 'filename': {
28
- 'anyOf': [{
29
- 'type': 'string',
30
- 'minLength': 1
31
- }, {
32
- 'instanceof': 'Function'
33
- }]
34
- },
35
- 'chunkFilename': {
36
- 'type': 'string',
37
- 'minLength': 1
38
- },
39
- 'esModule': {
40
- 'type': 'boolean'
41
- }
42
- },
43
- 'additionalProperties': false
44
- }; // eslint-disable-next-line
45
-
46
- function loader() {}
47
-
48
- function getDefaultFilename(filename) {
49
- if (typeof filename === 'function') {
50
- return filename;
51
- }
52
-
53
- return filename.replace(/\.([a-z]+)(\?.+)?$/i, '.worker.$1$2');
54
- }
55
-
56
- function getDefaultChunkFilename(chunkFilename) {
57
- return chunkFilename.replace(/\.([a-z]+)(\?.+)?$/i, '.worker.$1$2');
58
- }
59
-
60
- function pitch(request) {
61
- this.cacheable(false);
62
- const options = this.getOptions(); // console.log(this.getOptions());
63
- // validateOptions(schema, options, {
64
- // name: 'Worker Loader',
65
- // baseDataPath: 'options'
66
- // });
67
-
68
- const workerContext = {};
69
- const compilerOptions = this._compiler.options || {};
70
- const filename = options.filename ? options.filename : getDefaultFilename(compilerOptions.output.filename);
71
- const chunkFilename = options.chunkFilename ? options.chunkFilename : getDefaultChunkFilename(compilerOptions.output.chunkFilename);
72
- const publicPath = options.publicPath ? options.publicPath : compilerOptions.output.publicPath;
73
- workerContext.options = {
74
- filename,
75
- chunkFilename,
76
- publicPath,
77
- globalObject: 'self'
78
- };
79
- workerContext.compiler = this._compilation.createChildCompiler(`worker-loader ${request}`, workerContext.options);
80
- /*
81
- new WebWorkerTemplatePlugin().apply(workerContext.compiler);
82
-
83
- if (compilerOptions.externals) {
84
- new ExternalsPlugin(
85
- getExternalsType(compilerOptions),
86
- compilerOptions.externals
87
- ).apply(workerContext.compiler);
88
- } */
89
-
90
- new _SingleEntryPlugin.default(this.context, `!!${request}`, _path.default.parse(this.resourcePath).name).apply(workerContext.compiler);
91
- workerContext.request = request;
92
- const cb = this.async();
93
- workerContext.compiler.runAsChild((errorArg, entries, compilation) => {
94
- let error = errorArg;
95
-
96
- if (!error && compilation.errors && compilation.errors.length) {
97
- // eslint-disable-next-line
98
- error = compilation.errors[0];
99
- }
100
-
101
- const entry = entries && entries[0] && entries[0].files.values().next().value;
102
-
103
- if (!error && !entry) {
104
- error = Error(`WorkerPlugin: no entry for ${request}`);
105
- }
106
-
107
- if (error) {
108
- return cb(error);
109
- }
110
-
111
- function workerCode() {
112
- let blob;
113
-
114
- try {
115
- blob = new Blob([`importScripts('${this.workerUrl}');`], {
116
- 'type': 'application/javascript'
117
- });
118
- } catch (e1) {
119
- throw new Error(e1);
120
- }
121
-
122
- let url = window.URL || window.webkitURL;
123
- let blobUrl = url.createObjectURL(blob);
124
- let worker = new Worker(blobUrl);
125
- return worker;
126
- }
127
-
128
- return cb(null, `${options.esModule ? 'export default' : 'module.exports ='} {\n
129
- workerUrl: __webpack_public_path__ + ${JSON.stringify(entry)}, \n
130
- getInstance: ${workerCode} \n
131
- }`);
132
- });
133
- }
@@ -1,39 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.optimizationConfig = optimizationConfig;
7
-
8
- var _nameTemplates = require("./common/nameTemplates");
9
-
10
- var _hashUtils = require("./custom_plugins/I18nSplitPlugin/utils/hashUtils");
11
-
12
- var _splitChunksConfig = require("./splitChunksConfig");
13
-
14
- function optimizationConfig(options) {
15
- const {
16
- changeRuntimeChunkChar
17
- } = options;
18
- const {
19
- chunkSplitEnable
20
- } = options.i18nChunkSplit;
21
- const i18nChunkFilename = (0, _nameTemplates.nameTemplates)('i18nchunkjs', options);
22
- const chunkFilenameHasContentHash = (0, _hashUtils.hasContentHash)(i18nChunkFilename);
23
- /**
24
- * NOTE: we only need multiple runtime files when we use contentHash
25
- * other wise we don't need multiple runtime files based locale
26
- * that's why we added chunkSplitEnable && chunkFilenameHasContentHash logic
27
- */
28
-
29
- const suffix = // chunkSplitEnable ? '_[locale]' : '';
30
- chunkSplitEnable && chunkFilenameHasContentHash ? '_[locale]' : '';
31
- const char = changeRuntimeChunkChar ? '-' : '~';
32
- return {
33
- splitChunks: (0, _splitChunksConfig.splitChunksConfig)(options),
34
- moduleIds: 'named',
35
- runtimeChunk: {
36
- name: entrypoint => `runtime${char}${entrypoint.name}${suffix}`
37
- }
38
- };
39
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.outputConfig = outputConfig;
7
-
8
- var _path = _interopRequireDefault(require("path"));
9
-
10
- var _constants = require("../../constants");
11
-
12
- var _nameTemplates = require("./common/nameTemplates");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function outputConfig(options) {
17
- const {
18
- output,
19
- publicPath
20
- } = options;
21
- return {
22
- filename: (0, _nameTemplates.nameTemplates)('js', options),
23
- chunkFilename: (0, _nameTemplates.nameTemplates)('chunkjs', options),
24
- publicPath,
25
- // clean: true,
26
- path: _path.default.resolve(_constants.appPath, output)
27
- };
28
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.configCdnChangePlugin = configCdnChangePlugin;
7
-
8
- var _CdnChangePlugin = _interopRequireDefault(require("../custom_plugins/CdnChangePlugin"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
- function configCdnChangePlugin(options) {
13
- const {
14
- cdnMapping
15
- } = options.app;
16
- console.log(cdnMapping);
17
- return new _CdnChangePlugin.default(cdnMapping);
18
- }
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.configCopyThirdpartyFile = configCopyThirdpartyFile;
7
-
8
- var _path = _interopRequireDefault(require("path"));
9
-
10
- var _copyWebpackPlugin = _interopRequireDefault(require("copy-webpack-plugin"));
11
-
12
- var _fs = require("fs");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function configCopyThirdpartyFile(options) {
17
- const {
18
- context
19
- } = options;
20
- const {
21
- tpFolder
22
- } = options.app;
23
-
24
- const tpFolderActualPath = tpFolder && _path.default.join(process.cwd(), context, tpFolder);
25
-
26
- if (!tpFolder || !(0, _fs.existsSync)(tpFolderActualPath)) {
27
- // console.log(tpFolderActualPath, 'not exist', tpFolder);
28
- return null;
29
- }
30
-
31
- return new _copyWebpackPlugin.default({
32
- patterns: [{
33
- from: `${tpFolderActualPath}/`,
34
- to: `./${tpFolder}/`,
35
- toType: 'dir'
36
- }]
37
- });
38
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.configEnvVariables = configEnvVariables;
7
-
8
- var _webpack = require("webpack");
9
-
10
- function configEnvVariables(options) {
11
- return new _webpack.DefinePlugin({
12
- __CLIENT__: true,
13
- __TEST__: false,
14
- __SERVER__: false,
15
- __DEVELOPMENT__: true,
16
- __LOCAL_PRODUCTION__: false,
17
- __DEVTOOLS__: true,
18
- __DOCS__: false,
19
- NODE_ENV: JSON.stringify('development'),
20
- 'process.env': {
21
- NODE_ENV: JSON.stringify('development')
22
- }
23
- });
24
- }
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.configHtmlWebpackPlugin = configHtmlWebpackPlugin;
7
-
8
- var _htmlWebpackPlugin = _interopRequireDefault(require("html-webpack-plugin"));
9
-
10
- var _constants = require("../../../constants");
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- function configHtmlWebpackPlugin(options) {
15
- const {
16
- htmlTemplate
17
- } = options.app;
18
- const {
19
- inject
20
- } = htmlTemplate;
21
- return new _htmlWebpackPlugin.default({
22
- filename: 'index.html',
23
- template: _constants.appInitialHTMLTemplatePath,
24
- minify: false,
25
- inject,
26
- scriptLoading: 'defer'
27
- });
28
- }
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.configI18nSplitPlugin = configI18nSplitPlugin;
7
-
8
- var _nameTemplates = require("../common/nameTemplates");
9
-
10
- var _I18nSplitPlugin = _interopRequireDefault(require("../custom_plugins/I18nSplitPlugin"));
11
-
12
- var _resourceBasedPublicPath = require("../common/resourceBasedPublicPath");
13
-
14
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
- function configI18nSplitPlugin(options) {
17
- const {
18
- i18nChunkSplit
19
- } = options;
20
- const i18nPublicPath = (0, _resourceBasedPublicPath.resourceBasedPublicPath)('i18n', options); // const i18nPublicPathAsExpression = publicPathAsExpression('i18n', options);
21
-
22
- return new _I18nSplitPlugin.default({
23
- jsResource: i18nChunkSplit.jsResource,
24
- localeVarName: i18nChunkSplit.localeVarName,
25
- jsonpFunc: i18nChunkSplit.jsonpFunc,
26
- templateLabel: i18nChunkSplit.templateLabel,
27
- disableDefault: i18nChunkSplit.disableDefault,
28
- filename: (0, _nameTemplates.nameTemplates)('i18njs', options),
29
- chunkFilename: (0, _nameTemplates.nameTemplates)('i18nchunkjs', options),
30
- publicPath: i18nPublicPath,
31
- i18nManifestFileName: (0, _nameTemplates.nameTemplates)('i18nmanifest', options),
32
- // template: (object, locale) => `window.loadI18n(${JSON.stringify(object)}, ${JSON.stringify(locale)})`,
33
- propertiesFolder: i18nChunkSplit.propertiesFolder
34
- });
35
- }
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.configIgnorePlugin = configIgnorePlugin;
7
-
8
- var _webpack = require("webpack");
9
-
10
- // eslint-disable-next-line no-unused-vars
11
- function configIgnorePlugin(options) {
12
- return new _webpack.IgnorePlugin({
13
- resourceRegExp: /^\.\/domain$/,
14
- contextRegExp: /moment$/
15
- });
16
- }
@@ -1,23 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.configMiniCSSExtractPlugin = configMiniCSSExtractPlugin;
7
-
8
- var _miniCssExtractPlugin = _interopRequireDefault(require("mini-css-extract-plugin"));
9
-
10
- var _nameTemplates = require("../common/nameTemplates");
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- function configMiniCSSExtractPlugin(options) {
15
- const {
16
- enableRTLSplit
17
- } = options.css.plugins.rtlSplit;
18
- const cssLTRFileNameTempalte = enableRTLSplit ? (0, _nameTemplates.nameTemplates)('cssdir', options) : (0, _nameTemplates.nameTemplates)('css', options);
19
- return new _miniCssExtractPlugin.default({
20
- filename: cssLTRFileNameTempalte,
21
- chunkFilename: cssLTRFileNameTempalte
22
- });
23
- }
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.configProgressPlugin = configProgressPlugin;
7
-
8
- var _webpack = _interopRequireDefault(require("webpack"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
- // eslint-disable-next-line no-unused-vars
13
- function configProgressPlugin(options) {
14
- return new _webpack.default.ProgressPlugin({
15
- handler: (percentage, message) => {
16
- console.info(percentage, message);
17
- }
18
- });
19
- }
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.configRtlCssPlugin = configRtlCssPlugin;
7
-
8
- var _RtlCssPlugin = require("../custom_plugins/RtlSplitPlugin/RtlCssPlugin");
9
-
10
- function configRtlCssPlugin(options) {
11
- const {
12
- enableRTLSplit,
13
- templateLabel,
14
- disableMinifySelector,
15
- dirVarName
16
- } = options.css.plugins.rtlSplit;
17
-
18
- if (!enableRTLSplit) {
19
- return null;
20
- }
21
-
22
- return new _RtlCssPlugin.RtlCssPlugin({
23
- templateLabel,
24
- disableMinifySelector,
25
- dirVarName
26
- });
27
- }