@zohodesk/client_build_tool 0.0.11-exp.22.0 → 0.0.11-exp.23.0
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.
package/lib/shared/bundler/webpack/custom_plugins/I18nNumericIndexPlugin/I18nGroupRuntimeModule.js
CHANGED
|
@@ -149,6 +149,43 @@ class I18nGroupRuntimeModule extends _webpack.RuntimeModule {
|
|
|
149
149
|
document.head.appendChild(script);
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
+
|
|
153
|
+
function toLower(str) {
|
|
154
|
+
return typeof str === 'string' ? str.toLowerCase() : str;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function findGroupByChunkId(chunkId) {
|
|
158
|
+
var directGroup = chunkNameToGroup[chunkId];
|
|
159
|
+
if (directGroup) {
|
|
160
|
+
return directGroup;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
var stringId = '' + chunkId;
|
|
164
|
+
if (chunkNameToGroup[stringId]) {
|
|
165
|
+
return chunkNameToGroup[stringId];
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (typeof __webpack_require__ !== 'undefined' && typeof __webpack_require__.u === 'function') {
|
|
169
|
+
var filename = __webpack_require__.u(chunkId) || '';
|
|
170
|
+
if (filename) {
|
|
171
|
+
var loweredFilename = toLower(filename);
|
|
172
|
+
for (var group in groupToChunkNames) {
|
|
173
|
+
if (!Object.prototype.hasOwnProperty.call(groupToChunkNames, group)) {
|
|
174
|
+
continue;
|
|
175
|
+
}
|
|
176
|
+
var chunkNames = groupToChunkNames[group] || [];
|
|
177
|
+
for (var i = 0; i < chunkNames.length; i++) {
|
|
178
|
+
var candidate = chunkNames[i];
|
|
179
|
+
if (candidate && loweredFilename.indexOf(toLower(candidate)) !== -1) {
|
|
180
|
+
return group;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return undefined;
|
|
188
|
+
}
|
|
152
189
|
|
|
153
190
|
// Store original webpack chunk loading function
|
|
154
191
|
var originalEnsureChunk = __webpack_require__.e;
|
|
@@ -212,6 +249,20 @@ class I18nGroupRuntimeModule extends _webpack.RuntimeModule {
|
|
|
212
249
|
}
|
|
213
250
|
|
|
214
251
|
function installLoadScriptHook(loadScript) {
|
|
252
|
+
if (typeof loadScript !== 'function') {
|
|
253
|
+
Object.defineProperty(__webpack_require__, 'l', {
|
|
254
|
+
configurable: true,
|
|
255
|
+
enumerable: true,
|
|
256
|
+
get: function() {
|
|
257
|
+
return loadScript;
|
|
258
|
+
},
|
|
259
|
+
set: function(newLoader) {
|
|
260
|
+
installLoadScriptHook(newLoader);
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
|
|
215
266
|
Object.defineProperty(__webpack_require__, 'l', {
|
|
216
267
|
configurable: true,
|
|
217
268
|
enumerable: true,
|
|
@@ -240,48 +291,4 @@ class I18nGroupRuntimeModule extends _webpack.RuntimeModule {
|
|
|
240
291
|
|
|
241
292
|
}
|
|
242
293
|
|
|
243
|
-
exports.I18nGroupRuntimeModule = I18nGroupRuntimeModule;
|
|
244
|
-
|
|
245
|
-
function toLower(str) {
|
|
246
|
-
return typeof str === 'string' ? str.toLowerCase() : str;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
function findGroupByChunkId(chunkId) {
|
|
250
|
-
var directGroup = chunkNameToGroup[chunkId];
|
|
251
|
-
|
|
252
|
-
if (directGroup) {
|
|
253
|
-
return directGroup;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
var stringId = '' + chunkId;
|
|
257
|
-
|
|
258
|
-
if (chunkNameToGroup[stringId]) {
|
|
259
|
-
return chunkNameToGroup[stringId];
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
if (typeof __webpack_require__ !== 'undefined' && typeof __webpack_require__.u === 'function') {
|
|
263
|
-
var filename = __webpack_require__.u(chunkId) || '';
|
|
264
|
-
|
|
265
|
-
if (filename) {
|
|
266
|
-
var loweredFilename = toLower(filename);
|
|
267
|
-
|
|
268
|
-
for (var group in groupToChunkNames) {
|
|
269
|
-
if (!Object.prototype.hasOwnProperty.call(groupToChunkNames, group)) {
|
|
270
|
-
continue;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
var chunkNames = groupToChunkNames[group] || [];
|
|
274
|
-
|
|
275
|
-
for (var i = 0; i < chunkNames.length; i++) {
|
|
276
|
-
var candidate = chunkNames[i];
|
|
277
|
-
|
|
278
|
-
if (candidate && loweredFilename.indexOf(toLower(candidate)) !== -1) {
|
|
279
|
-
return group;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
return undefined;
|
|
287
|
-
}
|
|
294
|
+
exports.I18nGroupRuntimeModule = I18nGroupRuntimeModule;
|
|
@@ -15,14 +15,11 @@ var _configCSSMinifierPlugin = require("./pluginConfigs/configCSSMinifierPlugin"
|
|
|
15
15
|
|
|
16
16
|
var _splitChunksConfig = require("./splitChunksConfig");
|
|
17
17
|
|
|
18
|
-
var _modeUtils = require("./common/modeUtils");
|
|
19
|
-
|
|
20
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
19
|
|
|
22
20
|
function optimizationConfig(options) {
|
|
23
21
|
const {
|
|
24
|
-
changeRuntimeChunkChar
|
|
25
|
-
mode
|
|
22
|
+
changeRuntimeChunkChar
|
|
26
23
|
} = options;
|
|
27
24
|
const {
|
|
28
25
|
chunkSplitEnable
|
|
@@ -38,26 +35,19 @@ function optimizationConfig(options) {
|
|
|
38
35
|
const suffix = // chunkSplitEnable ? '_[locale]' : '';
|
|
39
36
|
chunkSplitEnable && chunkFilenameHasContentHash ? '_[locale]' : '';
|
|
40
37
|
const char = changeRuntimeChunkChar;
|
|
41
|
-
const excludeList = options.optimization.jsExcludePath;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
minimizers.push(excludeList !== '' ? new _terserWebpackPlugin.default({
|
|
38
|
+
const excludeList = options.optimization.jsExcludePath;
|
|
39
|
+
return {
|
|
40
|
+
splitChunks: (0, _splitChunksConfig.splitChunksConfig)(options),
|
|
41
|
+
minimizer: [// For webpack@5 you can use the `...` syntax to extend existing minimizers (i.e. `terser-webpack-plugin`), uncomment the next line
|
|
42
|
+
// '...',
|
|
43
|
+
excludeList !== '' ? new _terserWebpackPlugin.default({
|
|
48
44
|
exclude: excludeList,
|
|
49
45
|
extractComments: false // Do not extract comments to .LICENSE.txt files
|
|
50
46
|
|
|
51
47
|
}) : new _terserWebpackPlugin.default({
|
|
52
48
|
extractComments: false // Do not extract comments to .LICENSE.txt files
|
|
53
49
|
|
|
54
|
-
}))
|
|
55
|
-
minimizers.push((0, _configCSSMinifierPlugin.configCSSMinifierPlugin)(options));
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
splitChunks: (0, _splitChunksConfig.splitChunksConfig)(options),
|
|
60
|
-
minimizer: minimizers.filter(Boolean),
|
|
50
|
+
}), (0, _configCSSMinifierPlugin.configCSSMinifierPlugin)(options)].filter(Boolean),
|
|
61
51
|
moduleIds: 'named',
|
|
62
52
|
runtimeChunk: {
|
|
63
53
|
name: entrypoint => `runtime${char}${entrypoint.name}${suffix}`
|