weboptimizer 2.0.1107 → 2.0.1111
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/configurator.d.ts +21 -2
- package/configurator.js +344 -295
- package/ejsLoader.js +6 -5
- package/index.d.ts +10 -1
- package/index.js +646 -572
- package/package.json +23 -3
- package/stylelintConfigurator.js +2 -1
- package/type.d.ts +5 -1
- package/webpackConfigurator.js +143 -143
package/webpackConfigurator.js
CHANGED
|
@@ -102,19 +102,20 @@ if (plugins.Offline) {
|
|
|
102
102
|
} // endregion
|
|
103
103
|
|
|
104
104
|
|
|
105
|
-
var
|
|
105
|
+
var configuration = (0, _configurator["default"])();
|
|
106
|
+
var _module = configuration.module; // region initialisation
|
|
106
107
|
// / region determine library name
|
|
107
108
|
|
|
108
109
|
var libraryName;
|
|
109
|
-
if (
|
|
110
|
-
libraryName =
|
|
111
|
-
if (['assign', 'global', 'this', 'var', 'window'].includes(
|
|
110
|
+
if (configuration.libraryName) libraryName = configuration.libraryName;else if (Object.keys(configuration.injection.entry.normalized).length > 1) libraryName = '[name]';else {
|
|
111
|
+
libraryName = configuration.name;
|
|
112
|
+
if (['assign', 'global', 'this', 'var', 'window'].includes(configuration.exportFormat.self)) libraryName = _clientnode["default"].stringConvertToValidVariableName(libraryName);
|
|
112
113
|
} // / endregion
|
|
113
114
|
// / region plugins
|
|
114
115
|
|
|
115
116
|
var pluginInstances = []; // // region define modules to ignore
|
|
116
117
|
|
|
117
|
-
var _iterator = _createForOfIteratorHelper([].concat(
|
|
118
|
+
var _iterator = _createForOfIteratorHelper([].concat(configuration.injection.ignorePattern)),
|
|
118
119
|
_step;
|
|
119
120
|
|
|
120
121
|
try {
|
|
@@ -149,7 +150,7 @@ for (var source in _module.replacements.normal) {
|
|
|
149
150
|
|
|
150
151
|
var htmlAvailable = false;
|
|
151
152
|
|
|
152
|
-
var _iterator2 = _createForOfIteratorHelper(
|
|
153
|
+
var _iterator2 = _createForOfIteratorHelper(configuration.files.html),
|
|
153
154
|
_step2;
|
|
154
155
|
|
|
155
156
|
try {
|
|
@@ -171,11 +172,11 @@ try {
|
|
|
171
172
|
_iterator2.f();
|
|
172
173
|
}
|
|
173
174
|
|
|
174
|
-
if (htmlAvailable &&
|
|
175
|
+
if (htmlAvailable && configuration.favicon && plugins.Favicon && _clientnode["default"].isFileSync(configuration.favicon.logo)) pluginInstances.push(new plugins.Favicon(configuration.favicon)); // // endregion
|
|
175
176
|
// // region provide offline functionality
|
|
176
177
|
|
|
177
|
-
if (htmlAvailable &&
|
|
178
|
-
if (!['serve', 'test:browser'].includes(
|
|
178
|
+
if (htmlAvailable && configuration.offline && plugins.Offline) {
|
|
179
|
+
if (!['serve', 'test:browser'].includes(configuration.givenCommandLineArguments[2])) for (var _i = 0, _Object$entries = Object.entries({
|
|
179
180
|
cascadingStyleSheet: 'css',
|
|
180
181
|
javaScript: 'js'
|
|
181
182
|
}); _i < _Object$entries.length; _i++) {
|
|
@@ -185,24 +186,23 @@ if (htmlAvailable && _configurator["default"].offline && plugins.Offline) {
|
|
|
185
186
|
|
|
186
187
|
var type = _name;
|
|
187
188
|
|
|
188
|
-
if (
|
|
189
|
-
var matches = Object.keys(
|
|
190
|
-
if (!Array.isArray(
|
|
189
|
+
if (configuration.inPlace[type]) {
|
|
190
|
+
var matches = Object.keys(configuration.inPlace[type]);
|
|
191
|
+
if (!Array.isArray(configuration.offline.common.excludeChunks)) configuration.offline.common.excludeChunks = [];
|
|
191
192
|
|
|
192
193
|
for (var _i2 = 0, _matches = matches; _i2 < _matches.length; _i2++) {
|
|
193
194
|
var _name2 = _matches[_i2];
|
|
194
|
-
|
|
195
|
-
_configurator["default"].offline.common.excludeChunks.push((0, _path.relative)(_configurator["default"].path.target.base, _configurator["default"].path.target.asset[type]) + "".concat(_name2, ".").concat(extension, "?").concat(_configurator["default"].hashAlgorithm, "=*"));
|
|
195
|
+
configuration.offline.common.excludeChunks.push((0, _path.relative)(configuration.path.target.base, configuration.path.target.asset[type]) + "".concat(_name2, ".").concat(extension, "?").concat(configuration.hashAlgorithm, "=*"));
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
if ([].concat(
|
|
200
|
-
if ([].concat(
|
|
199
|
+
if ([].concat(configuration.offline.use).includes('injectionManifest')) pluginInstances.push(new plugins.InjectManifest(_clientnode["default"].extend(true, configuration.offline.common, configuration.offline.injectionManifest)));
|
|
200
|
+
if ([].concat(configuration.offline.use).includes('generateServiceWorker')) pluginInstances.push(new plugins.GenerateServiceWorker(_clientnode["default"].extend(true, configuration.offline.common, configuration.offline.serviceWorker)));
|
|
201
201
|
} // // endregion
|
|
202
202
|
// // region provide build environment
|
|
203
203
|
|
|
204
204
|
|
|
205
|
-
if (
|
|
205
|
+
if (configuration.buildContext.definitions) pluginInstances.push(new _webpack.DefinePlugin(configuration.buildContext.definitions));
|
|
206
206
|
if (_module.provide) pluginInstances.push(new _webpack.ProvidePlugin(_module.provide)); // // endregion
|
|
207
207
|
// // region modules/assets
|
|
208
208
|
// /// region apply module pattern
|
|
@@ -214,12 +214,12 @@ pluginInstances.push({
|
|
|
214
214
|
if (Object.prototype.hasOwnProperty.call(compilation.assets, request)) {
|
|
215
215
|
var filePath = request.replace(/\?[^?]+$/, '');
|
|
216
216
|
|
|
217
|
-
var _type2 = _helper["default"].determineAssetType(filePath,
|
|
217
|
+
var _type2 = _helper["default"].determineAssetType(filePath, configuration.buildContext.types, configuration.path);
|
|
218
218
|
|
|
219
|
-
if (_type2 &&
|
|
219
|
+
if (_type2 && configuration.assetPattern[_type2] && new RegExp(configuration.assetPattern[_type2].includeFilePathRegularExpression).test(filePath) && !new RegExp(configuration.assetPattern[_type2].excludeFilePathRegularExpression).test(filePath)) {
|
|
220
220
|
var _source = compilation.assets[request].source();
|
|
221
221
|
|
|
222
|
-
if (typeof _source === 'string') compilation.assets[request] = new _webpackSources.RawSource(
|
|
222
|
+
if (typeof _source === 'string') compilation.assets[request] = new _webpackSources.RawSource(configuration.assetPattern[_type2].pattern.replace(/\{1\}/g, _source.replace(/\$/g, '$$$')));
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
}
|
|
@@ -248,7 +248,7 @@ pluginInstances.push({
|
|
|
248
248
|
.replace(/##-#-#-##/g, '%>')
|
|
249
249
|
*/
|
|
250
250
|
|
|
251
|
-
if (htmlAvailable && !['serve', 'test:browser'].includes(
|
|
251
|
+
if (htmlAvailable && !['serve', 'test:browser'].includes(configuration.givenCommandLineArguments[2]) && configuration.inPlace.cascadingStyleSheet && Object.keys(configuration.inPlace.cascadingStyleSheet).length || configuration.inPlace.javaScript && Object.keys(configuration.inPlace.javaScript).length) pluginInstances.push({
|
|
252
252
|
apply: function apply(compiler) {
|
|
253
253
|
var publicPath = compiler.options.output.publicPath || '';
|
|
254
254
|
if (publicPath && !publicPath.endsWith('/')) publicPath += '/';
|
|
@@ -261,10 +261,10 @@ if (htmlAvailable && !['serve', 'test:browser'].includes(_configurator["default"
|
|
|
261
261
|
var url = false;
|
|
262
262
|
|
|
263
263
|
if (tag.tagName === 'script') {
|
|
264
|
-
settings =
|
|
264
|
+
settings = configuration.inPlace.javaScript;
|
|
265
265
|
url = tag.attributes.src;
|
|
266
266
|
} else if (tag.tagName === 'style') {
|
|
267
|
-
settings =
|
|
267
|
+
settings = configuration.inPlace.cascadingStyleSheet;
|
|
268
268
|
url = tag.attributes.href;
|
|
269
269
|
}
|
|
270
270
|
|
|
@@ -316,15 +316,16 @@ if (htmlAvailable && !['serve', 'test:browser'].includes(_configurator["default"
|
|
|
316
316
|
}); // /// endregion
|
|
317
317
|
// /// region mark empty javaScript modules as dummy
|
|
318
318
|
|
|
319
|
-
if (!(
|
|
319
|
+
if (!(configuration.needed.javaScript || configuration.needed.javaScriptExtension || configuration.needed.typeScript || configuration.needed.typeScriptExtension)) configuration.files.compose.javaScript = (0, _path.resolve)(configuration.path.target.asset.javaScript, '.__dummy__.compiled.js'); // /// endregion
|
|
320
320
|
// /// region extract cascading style sheets
|
|
321
321
|
|
|
322
|
-
|
|
323
|
-
|
|
322
|
+
var cssOutputPath = configuration.files.compose.cascadingStyleSheet;
|
|
323
|
+
if (cssOutputPath && plugins.MiniCSSExtract) pluginInstances.push(new plugins.MiniCSSExtract({
|
|
324
|
+
filename: typeof cssOutputPath === 'string' ? (0, _path.relative)(configuration.path.target.base, cssOutputPath) : cssOutputPath
|
|
324
325
|
})); // /// endregion
|
|
325
326
|
// /// region performs implicit external logic
|
|
326
327
|
|
|
327
|
-
if (
|
|
328
|
+
if (configuration.injection.external.modules === '__implicit__')
|
|
328
329
|
/*
|
|
329
330
|
We only want to process modules from local context in library mode,
|
|
330
331
|
since a concrete project using this library should combine all assets
|
|
@@ -332,12 +333,12 @@ if (_configurator["default"].injection.external.modules === '__implicit__')
|
|
|
332
333
|
NOTE: Only native java script and json modules will be marked as
|
|
333
334
|
external dependency.
|
|
334
335
|
*/
|
|
335
|
-
|
|
336
|
+
configuration.injection.external.modules = function (_ref, callback) {
|
|
336
337
|
var context = _ref.context,
|
|
337
338
|
request = _ref.request;
|
|
338
339
|
if (typeof request !== 'string') return callback();
|
|
339
340
|
request = request.replace(/^!+/, '');
|
|
340
|
-
if (request.startsWith('/')) request = (0, _path.relative)(
|
|
341
|
+
if (request.startsWith('/')) request = (0, _path.relative)(configuration.path.context, request);
|
|
341
342
|
|
|
342
343
|
var _iterator4 = _createForOfIteratorHelper(_module.directoryNames),
|
|
343
344
|
_step4;
|
|
@@ -360,10 +361,10 @@ if (_configurator["default"].injection.external.modules === '__implicit__')
|
|
|
360
361
|
}
|
|
361
362
|
|
|
362
363
|
var filePath = _helper["default"].determineModuleFilePath(request, {}, {}, {
|
|
363
|
-
file:
|
|
364
|
-
},
|
|
364
|
+
file: configuration.extensions.file.external
|
|
365
|
+
}, configuration.path.context, context, configuration.path.ignore, _module.directoryNames, configuration["package"].main.fileNames, configuration["package"].main.propertyNames, configuration["package"].aliasPropertyNames, configuration.encoding);
|
|
365
366
|
|
|
366
|
-
if (filePath) for (var _i3 = 0, _Object$entries2 = Object.entries(
|
|
367
|
+
if (filePath) for (var _i3 = 0, _Object$entries2 = Object.entries(configuration.injection.external.aliases); _i3 < _Object$entries2.length; _i3++) {
|
|
367
368
|
var _Object$entries2$_i = (0, _slicedToArray2["default"])(_Object$entries2[_i3], 2),
|
|
368
369
|
pattern = _Object$entries2$_i[0],
|
|
369
370
|
targetConfiguration = _Object$entries2$_i[1];
|
|
@@ -382,8 +383,8 @@ if (_configurator["default"].injection.external.modules === '__implicit__')
|
|
|
382
383
|
target = target.substring(1);
|
|
383
384
|
var aliasedRequest = request.replace(replacementRegularExpression, target);
|
|
384
385
|
if (aliasedRequest !== request) match = Boolean(_helper["default"].determineModuleFilePath(aliasedRequest, {}, {}, {
|
|
385
|
-
file:
|
|
386
|
-
},
|
|
386
|
+
file: configuration.extensions.file.external
|
|
387
|
+
}, configuration.path.context, context, configuration.path.ignore, _module.directoryNames, configuration["package"].main.fileNames, configuration["package"].main.propertyNames, configuration["package"].aliasPropertyNames, configuration.encoding));
|
|
387
388
|
} else match = true;
|
|
388
389
|
|
|
389
390
|
if (match) {
|
|
@@ -394,47 +395,47 @@ if (_configurator["default"].injection.external.modules === '__implicit__')
|
|
|
394
395
|
}
|
|
395
396
|
} // endregion
|
|
396
397
|
|
|
397
|
-
var resolvedRequest = _helper["default"].determineExternalRequest(request,
|
|
398
|
+
var resolvedRequest = _helper["default"].determineExternalRequest(request, configuration.path.context, context, configuration.injection.entry.normalized, _module.directoryNames, _module.aliases, _module.replacements.normal, configuration.extensions, configuration.path.source.asset.base, configuration.path.ignore, _module.directoryNames, configuration["package"].main.fileNames, configuration["package"].main.propertyNames, configuration["package"].aliasPropertyNames, configuration.injection.external.implicit.pattern.include, configuration.injection.external.implicit.pattern.exclude, configuration.inPlace.externalLibrary.normal, configuration.inPlace.externalLibrary.dynamic, configuration.encoding);
|
|
398
399
|
|
|
399
400
|
if (resolvedRequest) {
|
|
400
401
|
var keys = ['amd', 'commonjs', 'commonjs2', 'root'];
|
|
401
402
|
var result = resolvedRequest;
|
|
402
403
|
|
|
403
|
-
if (Object.prototype.hasOwnProperty.call(
|
|
404
|
+
if (Object.prototype.hasOwnProperty.call(configuration.injection.external.aliases, request)) {
|
|
404
405
|
// region normal alias replacement
|
|
405
406
|
result = {
|
|
406
407
|
"default": request
|
|
407
408
|
};
|
|
408
409
|
|
|
409
|
-
if (typeof
|
|
410
|
+
if (typeof configuration.injection.external.aliases[request] === 'string') {
|
|
410
411
|
var _iterator5 = _createForOfIteratorHelper(keys),
|
|
411
412
|
_step5;
|
|
412
413
|
|
|
413
414
|
try {
|
|
414
415
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
415
416
|
var key = _step5.value;
|
|
416
|
-
result[key] =
|
|
417
|
+
result[key] = configuration.injection.external.aliases[request];
|
|
417
418
|
}
|
|
418
419
|
} catch (err) {
|
|
419
420
|
_iterator5.e(err);
|
|
420
421
|
} finally {
|
|
421
422
|
_iterator5.f();
|
|
422
423
|
}
|
|
423
|
-
} else if (typeof
|
|
424
|
+
} else if (typeof configuration.injection.external.aliases[request] === 'function') {
|
|
424
425
|
var _iterator6 = _createForOfIteratorHelper(keys),
|
|
425
426
|
_step6;
|
|
426
427
|
|
|
427
428
|
try {
|
|
428
429
|
for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
|
429
430
|
var _key2 = _step6.value;
|
|
430
|
-
result[_key2] =
|
|
431
|
+
result[_key2] = configuration.injection.external.aliases[request](request, _key2);
|
|
431
432
|
}
|
|
432
433
|
} catch (err) {
|
|
433
434
|
_iterator6.e(err);
|
|
434
435
|
} finally {
|
|
435
436
|
_iterator6.f();
|
|
436
437
|
}
|
|
437
|
-
} else if (
|
|
438
|
+
} else if (configuration.injection.external.aliases[request] !== null && (0, _typeof2["default"])(configuration.injection.external.aliases[request]) === 'object') _clientnode["default"].extend(result, configuration.injection.external.aliases[request]);
|
|
438
439
|
|
|
439
440
|
if (Object.prototype.hasOwnProperty.call(result, 'default')) {
|
|
440
441
|
var _iterator7 = _createForOfIteratorHelper(keys),
|
|
@@ -457,7 +458,7 @@ if (_configurator["default"].injection.external.modules === '__implicit__')
|
|
|
457
458
|
if (typeof result !== 'string' && Object.prototype.hasOwnProperty.call(result, 'root')) result.root = [].concat(result.root).map(function (name) {
|
|
458
459
|
return _clientnode["default"].stringConvertToValidVariableName(name);
|
|
459
460
|
});
|
|
460
|
-
var exportFormat =
|
|
461
|
+
var exportFormat = configuration.exportFormat.external || configuration.exportFormat.self;
|
|
461
462
|
return callback(undefined, exportFormat === 'umd' || typeof result === 'string' ? result : result[exportFormat], exportFormat);
|
|
462
463
|
}
|
|
463
464
|
|
|
@@ -499,7 +500,7 @@ if (htmlAvailable) pluginInstances.push({
|
|
|
499
500
|
};
|
|
500
501
|
|
|
501
502
|
for (var tagName in linkables) {
|
|
502
|
-
if (Object.prototype.hasOwnProperty.call(linkables, tagName)) for (var _i4 = 0, _Array$from = Array.from(dom.window.document.querySelectorAll("".concat(tagName, "[").concat(linkables[tagName], "*=\"?") + "".concat(
|
|
503
|
+
if (Object.prototype.hasOwnProperty.call(linkables, tagName)) for (var _i4 = 0, _Array$from = Array.from(dom.window.document.querySelectorAll("".concat(tagName, "[").concat(linkables[tagName], "*=\"?") + "".concat(configuration.hashAlgorithm, "=\"]"))); _i4 < _Array$from.length; _i4++) {
|
|
503
504
|
var domNode = _Array$from[_i4];
|
|
504
505
|
|
|
505
506
|
/*
|
|
@@ -507,7 +508,7 @@ if (htmlAvailable) pluginInstances.push({
|
|
|
507
508
|
string is necessary to match the generated
|
|
508
509
|
request strings in offline plugin.
|
|
509
510
|
*/
|
|
510
|
-
domNode.setAttribute(linkables[tagName], domNode.getAttribute(linkables[tagName]).replace(new RegExp('(\\?' + "".concat(
|
|
511
|
+
domNode.setAttribute(linkables[tagName], domNode.getAttribute(linkables[tagName]).replace(new RegExp('(\\?' + "".concat(configuration.hashAlgorithm, "=") + '[^&]+).*$'), '$1'));
|
|
511
512
|
}
|
|
512
513
|
}
|
|
513
514
|
/*
|
|
@@ -520,7 +521,7 @@ if (htmlAvailable) pluginInstances.push({
|
|
|
520
521
|
return "".concat(startTag).concat(styleContents.shift()) + endTag;
|
|
521
522
|
}); // region post compilation
|
|
522
523
|
|
|
523
|
-
var _iterator8 = _createForOfIteratorHelper(
|
|
524
|
+
var _iterator8 = _createForOfIteratorHelper(configuration.files.html),
|
|
524
525
|
_step8;
|
|
525
526
|
|
|
526
527
|
try {
|
|
@@ -571,7 +572,7 @@ try {
|
|
|
571
572
|
var contextReplacement = _step10.value;
|
|
572
573
|
pluginInstances.push((0, _construct2["default"])(_webpack.ContextReplacementPlugin, (0, _toConsumableArray2["default"])(contextReplacement.map(function (value) {
|
|
573
574
|
var evaluated = _clientnode["default"].stringEvaluate(value, {
|
|
574
|
-
configuration:
|
|
575
|
+
configuration: configuration,
|
|
575
576
|
__dirname: __dirname,
|
|
576
577
|
__filename: __filename
|
|
577
578
|
});
|
|
@@ -596,7 +597,7 @@ try {
|
|
|
596
597
|
}
|
|
597
598
|
|
|
598
599
|
if (_module.enforceDeduplication) {
|
|
599
|
-
var absoluteContextPath = (0, _path.resolve)(
|
|
600
|
+
var absoluteContextPath = (0, _path.resolve)(configuration.path.context);
|
|
600
601
|
|
|
601
602
|
var consolidator = function consolidator(result) {
|
|
602
603
|
var targetPath = result.createData.resource;
|
|
@@ -792,23 +793,23 @@ new NormalModuleReplacementPlugin(
|
|
|
792
793
|
|
|
793
794
|
var isFilePathInDependencies = function isFilePathInDependencies(filePath) {
|
|
794
795
|
filePath = _helper["default"].stripLoader(filePath);
|
|
795
|
-
return _helper["default"].isFilePathInLocation(filePath,
|
|
796
|
-
return (0, _path.resolve)(
|
|
796
|
+
return _helper["default"].isFilePathInLocation(filePath, configuration.path.ignore.concat(_module.directoryNames, configuration.loader.directoryNames).map(function (filePath) {
|
|
797
|
+
return (0, _path.resolve)(configuration.path.context, filePath);
|
|
797
798
|
}).filter(function (filePath) {
|
|
798
|
-
return !
|
|
799
|
+
return !configuration.path.context.startsWith(filePath);
|
|
799
800
|
}));
|
|
800
801
|
};
|
|
801
802
|
|
|
802
803
|
var loader = {};
|
|
803
804
|
var scope = {
|
|
804
|
-
configuration:
|
|
805
|
+
configuration: configuration,
|
|
805
806
|
isFilePathInDependencies: isFilePathInDependencies,
|
|
806
807
|
loader: loader,
|
|
807
808
|
require: eval('require')
|
|
808
809
|
};
|
|
809
810
|
|
|
810
811
|
var evaluate = function evaluate(object) {
|
|
811
|
-
var filePath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] :
|
|
812
|
+
var filePath = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : configuration.path.context;
|
|
812
813
|
|
|
813
814
|
if (typeof object === 'string') {
|
|
814
815
|
var evaluated = _clientnode["default"].stringEvaluate(object, _objectSpread({
|
|
@@ -831,13 +832,13 @@ var evaluateAdditionalLoaderConfiguration = function evaluateAdditionalLoaderCon
|
|
|
831
832
|
exclude: function exclude(filePath) {
|
|
832
833
|
return Boolean(evaluate(loaderConfiguration.exclude, filePath));
|
|
833
834
|
},
|
|
834
|
-
include: loaderConfiguration.include && evaluate(loaderConfiguration.include) ||
|
|
835
|
+
include: loaderConfiguration.include && evaluate(loaderConfiguration.include) || configuration.path.source.base,
|
|
835
836
|
test: new RegExp(evaluate(loaderConfiguration.test)),
|
|
836
837
|
use: evaluate(loaderConfiguration.use)
|
|
837
838
|
};
|
|
838
839
|
};
|
|
839
840
|
|
|
840
|
-
var includingPaths = _helper["default"].normalizePaths([
|
|
841
|
+
var includingPaths = _helper["default"].normalizePaths([configuration.path.source.asset.javaScript].concat(_module.locations.directoryPaths));
|
|
841
842
|
|
|
842
843
|
var cssUse = _module.preprocessor.cascadingStyleSheet.additional.pre.map(evaluateMapper).concat({
|
|
843
844
|
loader: _module.style.loader,
|
|
@@ -855,7 +856,7 @@ var cssUse = _module.preprocessor.cascadingStyleSheet.additional.pre.map(evaluat
|
|
|
855
856
|
consumer decide which distribution suites most.
|
|
856
857
|
*/
|
|
857
858
|
plugins: [].concat(postcssImport ? postcssImport({
|
|
858
|
-
root:
|
|
859
|
+
root: configuration.path.context
|
|
859
860
|
}) : [], _module.preprocessor.cascadingStyleSheet.additional.plugins.pre.map(evaluateMapper),
|
|
860
861
|
/*
|
|
861
862
|
NOTE: Checking path doesn't work if fonts
|
|
@@ -877,16 +878,16 @@ var cssUse = _module.preprocessor.cascadingStyleSheet.additional.pre.map(evaluat
|
|
|
877
878
|
}) : [], postcssSprites ? postcssSprites({
|
|
878
879
|
filterBy: function filterBy() {
|
|
879
880
|
return new Promise(function (resolve, reject) {
|
|
880
|
-
return (
|
|
881
|
+
return (configuration.files.compose.image ? resolve : reject)();
|
|
881
882
|
});
|
|
882
883
|
},
|
|
883
884
|
hooks: {
|
|
884
885
|
onSaveSpritesheet: function onSaveSpritesheet(image) {
|
|
885
|
-
return (0, _path.join)(image.spritePath, (0, _path.relative)(
|
|
886
|
+
return (0, _path.join)(image.spritePath, (0, _path.relative)(configuration.path.target.asset.image, configuration.files.compose.image));
|
|
886
887
|
}
|
|
887
888
|
},
|
|
888
|
-
stylesheetPath:
|
|
889
|
-
spritePath:
|
|
889
|
+
stylesheetPath: configuration.path.source.asset.cascadingStyleSheet,
|
|
890
|
+
spritePath: configuration.path.source.asset.image
|
|
890
891
|
}) : [], _module.preprocessor.cascadingStyleSheet.additional.plugins.post.map(evaluateMapper), _module.optimizer.cssnano && postcssCSSnano ? postcssCSSnano(_module.optimizer.cssnano) : [])
|
|
891
892
|
}
|
|
892
893
|
} : {}, _module.preprocessor.cascadingStyleSheet.options || {})
|
|
@@ -897,7 +898,7 @@ var genericLoader = {
|
|
|
897
898
|
// region generic template
|
|
898
899
|
ejs: {
|
|
899
900
|
exclude: function exclude(filePath) {
|
|
900
|
-
return _helper["default"].normalizePaths(
|
|
901
|
+
return _helper["default"].normalizePaths(configuration.files.html.concat(configuration.files.defaultHTML).map(function (htmlConfiguration) {
|
|
901
902
|
return htmlConfiguration.template.filePath;
|
|
902
903
|
})).includes(filePath) || _module.preprocessor.ejs.exclude === null ? false : Boolean(evaluate(_module.preprocessor.ejs.exclude, filePath));
|
|
903
904
|
},
|
|
@@ -906,7 +907,7 @@ var genericLoader = {
|
|
|
906
907
|
use: _module.preprocessor.ejs.additional.pre.map(evaluateMapper).concat({
|
|
907
908
|
loader: 'file?name=[path][name]' + ((_clientnode["default"].isPlainObject(_module.preprocessor.ejs.options) ? _module.preprocessor.ejs.options : {
|
|
908
909
|
compileSteps: 2
|
|
909
|
-
}).compileSteps % 2 ? '.js' : '') + "?".concat(
|
|
910
|
+
}).compileSteps % 2 ? '.js' : '') + "?".concat(configuration.hashAlgorithm, "=[chunkhash]")
|
|
910
911
|
}, {
|
|
911
912
|
loader: 'extract'
|
|
912
913
|
}, {
|
|
@@ -954,21 +955,21 @@ var genericLoader = {
|
|
|
954
955
|
html: {
|
|
955
956
|
// NOTE: This is only for the main entry template.
|
|
956
957
|
main: {
|
|
957
|
-
test: new RegExp('^' + _clientnode["default"].stringEscapeRegularExpressions(
|
|
958
|
-
use:
|
|
958
|
+
test: new RegExp('^' + _clientnode["default"].stringEscapeRegularExpressions(configuration.files.defaultHTML.template.filePath) + '(?:\\?.*)?$'),
|
|
959
|
+
use: configuration.files.defaultHTML.template.use
|
|
959
960
|
},
|
|
960
961
|
ejs: {
|
|
961
962
|
exclude: function exclude(filePath) {
|
|
962
|
-
return _helper["default"].normalizePaths(
|
|
963
|
+
return _helper["default"].normalizePaths(configuration.files.html.concat(configuration.files.defaultHTML).map(function (htmlConfiguration) {
|
|
963
964
|
return htmlConfiguration.template.filePath;
|
|
964
965
|
})).includes(filePath) || (_module.preprocessor.html.exclude === null ? false : Boolean(evaluate(_module.preprocessor.html.exclude, filePath)));
|
|
965
966
|
},
|
|
966
|
-
include:
|
|
967
|
+
include: configuration.path.source.asset.template,
|
|
967
968
|
test: /\.html\.ejs(?:\?.*)?$/i,
|
|
968
969
|
use: _module.preprocessor.html.additional.pre.map(evaluateMapper).concat({
|
|
969
|
-
loader: 'file?name=' + (0, _path.join)((0, _path.relative)(
|
|
970
|
+
loader: 'file?name=' + (0, _path.join)((0, _path.relative)(configuration.path.target.asset.base, configuration.path.target.asset.template), '[name]' + ((_clientnode["default"].isPlainObject(_module.preprocessor.html.options) ? _module.preprocessor.html.options : {
|
|
970
971
|
compileSteps: 2
|
|
971
|
-
}).compileSteps % 2 ? '.js' : '') + "?".concat(
|
|
972
|
+
}).compileSteps % 2 ? '.js' : '') + "?".concat(configuration.hashAlgorithm, "=[chunkhash]"))
|
|
972
973
|
}, (_clientnode["default"].isPlainObject(_module.preprocessor.html.options) ? _module.preprocessor.html.options : {
|
|
973
974
|
compileSteps: 2
|
|
974
975
|
}).compileSteps % 2 ? [] : [{
|
|
@@ -983,14 +984,14 @@ var genericLoader = {
|
|
|
983
984
|
},
|
|
984
985
|
html: {
|
|
985
986
|
exclude: function exclude(filePath) {
|
|
986
|
-
return _helper["default"].normalizePaths(
|
|
987
|
+
return _helper["default"].normalizePaths(configuration.files.html.concat(configuration.files.defaultHTML).map(function (htmlConfiguration) {
|
|
987
988
|
return htmlConfiguration.template.filePath;
|
|
988
989
|
})).includes(filePath) || (_module.html.exclude === null ? true : Boolean(evaluate(_module.html.exclude, filePath)));
|
|
989
990
|
},
|
|
990
|
-
include:
|
|
991
|
+
include: configuration.path.source.asset.template,
|
|
991
992
|
test: /\.html(?:\?.*)?$/i,
|
|
992
993
|
use: _module.html.additional.pre.map(evaluateMapper).concat({
|
|
993
|
-
loader: 'file?name=' + (0, _path.join)((0, _path.relative)(
|
|
994
|
+
loader: 'file?name=' + (0, _path.join)((0, _path.relative)(configuration.path.target.base, configuration.path.target.asset.template), "[name][ext]?".concat(configuration.hashAlgorithm, "=") + '[chunkhash]')
|
|
994
995
|
}, {
|
|
995
996
|
loader: 'extract'
|
|
996
997
|
}, {
|
|
@@ -1041,13 +1042,13 @@ var genericLoader = {
|
|
|
1041
1042
|
return _module.optimizer.font.eot.exclude === null ? false : Boolean(evaluate(_module.optimizer.font.eot.exclude, filePath));
|
|
1042
1043
|
},
|
|
1043
1044
|
generator: {
|
|
1044
|
-
filename: (0, _path.join)((0, _path.relative)(
|
|
1045
|
+
filename: (0, _path.join)((0, _path.relative)(configuration.path.target.base, configuration.path.target.asset.font), '[name][ext]') + "?".concat(configuration.hashAlgorithm, "=[chunkhash]")
|
|
1045
1046
|
},
|
|
1046
1047
|
test: /\.eot(?:\?.*)?$/i,
|
|
1047
1048
|
type: 'asset/resource',
|
|
1048
1049
|
parser: {
|
|
1049
1050
|
dataUrlCondition: {
|
|
1050
|
-
maxSize:
|
|
1051
|
+
maxSize: configuration.inPlace.otherMaximumFileSizeLimitInByte
|
|
1051
1052
|
}
|
|
1052
1053
|
},
|
|
1053
1054
|
use: _module.optimizer.font.eot.loader.map(evaluateMapper)
|
|
@@ -1056,14 +1057,14 @@ var genericLoader = {
|
|
|
1056
1057
|
exclude: function exclude(filePath) {
|
|
1057
1058
|
return _module.optimizer.font.svg.exclude === null ? false : Boolean(evaluate(_module.optimizer.font.svg.exclude, filePath));
|
|
1058
1059
|
},
|
|
1059
|
-
include:
|
|
1060
|
+
include: configuration.path.source.asset.font,
|
|
1060
1061
|
generator: {
|
|
1061
|
-
filename: (0, _path.join)((0, _path.relative)(
|
|
1062
|
+
filename: (0, _path.join)((0, _path.relative)(configuration.path.target.base, configuration.path.target.asset.font), '[name][ext]') + "?".concat(configuration.hashAlgorithm, "=[chunkhash]")
|
|
1062
1063
|
},
|
|
1063
1064
|
mimetype: 'image/svg+xml',
|
|
1064
1065
|
parser: {
|
|
1065
1066
|
dataUrlCondition: {
|
|
1066
|
-
maxSize:
|
|
1067
|
+
maxSize: configuration.inPlace.otherMaximumFileSizeLimitInByte
|
|
1067
1068
|
}
|
|
1068
1069
|
},
|
|
1069
1070
|
test: /\.svg(?:\?.*)?$/i,
|
|
@@ -1075,14 +1076,14 @@ var genericLoader = {
|
|
|
1075
1076
|
return _module.optimizer.font.ttf.exclude === null ? false : Boolean(evaluate(_module.optimizer.font.ttf.exclude, filePath));
|
|
1076
1077
|
},
|
|
1077
1078
|
generator: {
|
|
1078
|
-
filename: (0, _path.join)((0, _path.relative)(
|
|
1079
|
+
filename: (0, _path.join)((0, _path.relative)(configuration.path.target.base, configuration.path.target.asset.font), '[name][ext]') + "?".concat(configuration.hashAlgorithm, "=[chunkhash]")
|
|
1079
1080
|
},
|
|
1080
1081
|
test: /\.ttf(?:\?.*)?$/i,
|
|
1081
1082
|
type: 'asset/resource',
|
|
1082
1083
|
mimetype: 'application/octet-stream',
|
|
1083
1084
|
parser: {
|
|
1084
1085
|
dataUrlCondition: {
|
|
1085
|
-
maxSize:
|
|
1086
|
+
maxSize: configuration.inPlace.otherMaximumFileSizeLimitInByte
|
|
1086
1087
|
}
|
|
1087
1088
|
},
|
|
1088
1089
|
use: _module.optimizer.font.ttf.loader.map(evaluateMapper)
|
|
@@ -1092,13 +1093,13 @@ var genericLoader = {
|
|
|
1092
1093
|
return _module.optimizer.font.woff.exclude === null ? false : Boolean(evaluate(_module.optimizer.font.woff.exclude, filePath));
|
|
1093
1094
|
},
|
|
1094
1095
|
generator: {
|
|
1095
|
-
filename: (0, _path.join)((0, _path.relative)(
|
|
1096
|
+
filename: (0, _path.join)((0, _path.relative)(configuration.path.target.base, configuration.path.target.asset.font), '[name][ext]') + "?".concat(configuration.hashAlgorithm, "=[chunkhash]")
|
|
1096
1097
|
},
|
|
1097
1098
|
test: /\.woff2?(?:\?.*)?$/i,
|
|
1098
1099
|
type: 'asset/resource',
|
|
1099
1100
|
parser: {
|
|
1100
1101
|
dataUrlCondition: {
|
|
1101
|
-
maxSize:
|
|
1102
|
+
maxSize: configuration.inPlace.otherMaximumFileSizeLimitInByte
|
|
1102
1103
|
}
|
|
1103
1104
|
},
|
|
1104
1105
|
use: _module.optimizer.font.woff.loader.map(evaluateMapper)
|
|
@@ -1111,14 +1112,14 @@ var genericLoader = {
|
|
|
1111
1112
|
return _module.optimizer.image.exclude === null ? isFilePathInDependencies(filePath) : Boolean(evaluate(_module.optimizer.image.exclude, filePath));
|
|
1112
1113
|
},
|
|
1113
1114
|
generator: {
|
|
1114
|
-
filename: (0, _path.join)((0, _path.relative)(
|
|
1115
|
+
filename: (0, _path.join)((0, _path.relative)(configuration.path.target.base, configuration.path.target.asset.image), '[name][ext]') + "?".concat(configuration.hashAlgorithm, "=[chunkhash]")
|
|
1115
1116
|
},
|
|
1116
|
-
include:
|
|
1117
|
+
include: configuration.path.source.asset.image,
|
|
1117
1118
|
test: /\.(?:gif|ico|jpg|png|svg)(?:\?.*)?$/i,
|
|
1118
1119
|
type: 'asset/resource',
|
|
1119
1120
|
parser: {
|
|
1120
1121
|
dataUrlCondition: {
|
|
1121
|
-
maxSize:
|
|
1122
|
+
maxSize: configuration.inPlace.otherMaximumFileSizeLimitInByte
|
|
1122
1123
|
}
|
|
1123
1124
|
},
|
|
1124
1125
|
use: _module.optimizer.image.loader.map(evaluateMapper)
|
|
@@ -1128,16 +1129,16 @@ var genericLoader = {
|
|
|
1128
1129
|
data: {
|
|
1129
1130
|
exclude: function exclude(filePath) {
|
|
1130
1131
|
if (typeof filePath !== 'string') return false;
|
|
1131
|
-
return
|
|
1132
|
+
return configuration.extensions.file.internal.includes((0, _path.extname)(_helper["default"].stripLoader(filePath))) || (_module.optimizer.data.exclude === null ? isFilePathInDependencies(filePath) : Boolean(evaluate(_module.optimizer.data.exclude, filePath)));
|
|
1132
1133
|
},
|
|
1133
1134
|
generator: {
|
|
1134
|
-
filename: (0, _path.join)((0, _path.relative)(
|
|
1135
|
+
filename: (0, _path.join)((0, _path.relative)(configuration.path.target.base, configuration.path.target.asset.data), '[name][ext]') + "?".concat(configuration.hashAlgorithm, "=[chunkhash]")
|
|
1135
1136
|
},
|
|
1136
1137
|
test: /.+/,
|
|
1137
1138
|
type: 'asset/resource',
|
|
1138
1139
|
parser: {
|
|
1139
1140
|
dataUrlCondition: {
|
|
1140
|
-
maxSize:
|
|
1141
|
+
maxSize: configuration.inPlace.otherMaximumFileSizeLimitInByte
|
|
1141
1142
|
}
|
|
1142
1143
|
},
|
|
1143
1144
|
use: _module.optimizer.data.loader.map(evaluateMapper)
|
|
@@ -1147,7 +1148,7 @@ var genericLoader = {
|
|
|
1147
1148
|
|
|
1148
1149
|
_clientnode["default"].extend(loader, genericLoader);
|
|
1149
1150
|
|
|
1150
|
-
if (
|
|
1151
|
+
if (configuration.files.compose.cascadingStyleSheet && plugins.MiniCSSExtract) {
|
|
1151
1152
|
/*
|
|
1152
1153
|
NOTE: We have to remove the client side javascript hmr style loader
|
|
1153
1154
|
first.
|
|
@@ -1166,13 +1167,12 @@ if (_configurator["default"].files.compose.cascadingStyleSheet && plugins.MiniCS
|
|
|
1166
1167
|
*/
|
|
1167
1168
|
|
|
1168
1169
|
|
|
1169
|
-
if (htmlAvailable &&
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
if (_configurator["default"].development.server.hot) {
|
|
1173
|
-
_configurator["default"].injection.entry.normalized.developmentHandler.push('webpack/hot/dev-server.js');
|
|
1170
|
+
if (htmlAvailable && configuration.debug && configuration.development.server.liveReload && !configuration.injection.entry.normalized.developmentHandler && ['serve', 'test:browser'].includes(configuration.givenCommandLineArguments[2])) {
|
|
1171
|
+
configuration.injection.entry.normalized.developmentHandler = ['webpack-dev-server/client/index.js?live-reload=true&hot=' + "".concat(configuration.development.server.hot ? 'true' : 'false', "&http") + "".concat(configuration.development.server.https ? 's' : '', "://") + "".concat(configuration.development.server.host, ":") + "".concat(configuration.development.server.port)];
|
|
1174
1172
|
|
|
1175
|
-
|
|
1173
|
+
if (configuration.development.server.hot) {
|
|
1174
|
+
configuration.injection.entry.normalized.developmentHandler.push('webpack/hot/dev-server.js');
|
|
1175
|
+
configuration.development.server.hot = false;
|
|
1176
1176
|
pluginInstances.push(new _webpack.HotModuleReplacementPlugin());
|
|
1177
1177
|
}
|
|
1178
1178
|
} // / endregion
|
|
@@ -1180,7 +1180,7 @@ if (htmlAvailable && _configurator["default"].debug && _configurator["default"].
|
|
|
1180
1180
|
// region plugins
|
|
1181
1181
|
|
|
1182
1182
|
|
|
1183
|
-
var _iterator15 = _createForOfIteratorHelper(
|
|
1183
|
+
var _iterator15 = _createForOfIteratorHelper(configuration.plugins),
|
|
1184
1184
|
_step15;
|
|
1185
1185
|
|
|
1186
1186
|
try {
|
|
@@ -1223,82 +1223,82 @@ if (!_module.optimizer.minimizer) {
|
|
|
1223
1223
|
|
|
1224
1224
|
|
|
1225
1225
|
var customConfiguration = {};
|
|
1226
|
-
if ((_configuration$path$c =
|
|
1227
|
-
require.resolve(
|
|
1226
|
+
if ((_configuration$path$c = configuration.path.configuration) !== null && _configuration$path$c !== void 0 && _configuration$path$c.json) try {
|
|
1227
|
+
require.resolve(configuration.path.configuration.json);
|
|
1228
1228
|
|
|
1229
1229
|
try {
|
|
1230
|
-
customConfiguration = (0, _clientnode.currentRequire)(
|
|
1230
|
+
customConfiguration = (0, _clientnode.currentRequire)(configuration.path.configuration.json);
|
|
1231
1231
|
} catch (error) {
|
|
1232
|
-
console.debug('Importing provided json webpack configuration file path ' + "under \"".concat(
|
|
1232
|
+
console.debug('Importing provided json webpack configuration file path ' + "under \"".concat(configuration.path.configuration.json, "\" failed: ") + _clientnode["default"].represent(error));
|
|
1233
1233
|
}
|
|
1234
1234
|
} catch (error) {
|
|
1235
|
-
console.debug('Optional configuration file "' + "".concat(
|
|
1235
|
+
console.debug('Optional configuration file "' + "".concat(configuration.path.configuration.json, "\" not available."));
|
|
1236
1236
|
}
|
|
1237
1237
|
|
|
1238
1238
|
var webpackConfiguration = _clientnode["default"].extend(true, {
|
|
1239
|
-
bail: !
|
|
1240
|
-
context:
|
|
1241
|
-
devtool:
|
|
1242
|
-
devServer:
|
|
1239
|
+
bail: !configuration.givenCommandLineArguments.includes('--watch'),
|
|
1240
|
+
context: configuration.path.context,
|
|
1241
|
+
devtool: configuration.development.tool,
|
|
1242
|
+
devServer: configuration.development.server,
|
|
1243
1243
|
experiments: {
|
|
1244
1244
|
topLevelAwait: true
|
|
1245
1245
|
},
|
|
1246
1246
|
// region input
|
|
1247
|
-
entry:
|
|
1248
|
-
externals:
|
|
1247
|
+
entry: configuration.injection.entry.normalized,
|
|
1248
|
+
externals: configuration.injection.external.modules,
|
|
1249
1249
|
resolve: {
|
|
1250
1250
|
alias: _module.aliases,
|
|
1251
|
-
aliasFields:
|
|
1252
|
-
extensions:
|
|
1253
|
-
mainFields:
|
|
1254
|
-
mainFiles:
|
|
1251
|
+
aliasFields: configuration["package"].aliasPropertyNames,
|
|
1252
|
+
extensions: configuration.extensions.file.internal,
|
|
1253
|
+
mainFields: configuration["package"].main.propertyNames,
|
|
1254
|
+
mainFiles: configuration["package"].main.fileNames,
|
|
1255
1255
|
modules: _helper["default"].normalizePaths(_module.directoryNames),
|
|
1256
1256
|
symlinks: _module.resolveSymlinks,
|
|
1257
|
-
unsafeCache: Boolean((_configuration$cache =
|
|
1257
|
+
unsafeCache: Boolean((_configuration$cache = configuration.cache) === null || _configuration$cache === void 0 ? void 0 : _configuration$cache.unsafe)
|
|
1258
1258
|
},
|
|
1259
1259
|
resolveLoader: {
|
|
1260
|
-
alias:
|
|
1261
|
-
aliasFields:
|
|
1262
|
-
extensions:
|
|
1263
|
-
mainFields:
|
|
1264
|
-
mainFiles:
|
|
1265
|
-
modules:
|
|
1266
|
-
symlinks:
|
|
1260
|
+
alias: configuration.loader.aliases,
|
|
1261
|
+
aliasFields: configuration["package"].aliasPropertyNames,
|
|
1262
|
+
extensions: configuration.loader.extensions.file,
|
|
1263
|
+
mainFields: configuration["package"].main.propertyNames,
|
|
1264
|
+
mainFiles: configuration["package"].main.fileNames,
|
|
1265
|
+
modules: configuration.loader.directoryNames,
|
|
1266
|
+
symlinks: configuration.loader.resolveSymlinks
|
|
1267
1267
|
},
|
|
1268
1268
|
// endregion
|
|
1269
1269
|
// region output
|
|
1270
1270
|
output: {
|
|
1271
|
-
assetModuleFilename: (0, _path.join)((0, _path.relative)(
|
|
1272
|
-
filename: (0, _path.relative)(
|
|
1273
|
-
globalObject:
|
|
1274
|
-
hashFunction:
|
|
1271
|
+
assetModuleFilename: (0, _path.join)((0, _path.relative)(configuration.path.target.base, configuration.path.target.asset.base), '[name][ext]') + "?".concat(configuration.hashAlgorithm, "=[chunkhash]"),
|
|
1272
|
+
filename: (0, _path.relative)(configuration.path.target.base, configuration.files.compose.javaScript),
|
|
1273
|
+
globalObject: configuration.exportFormat.globalObject,
|
|
1274
|
+
hashFunction: configuration.hashAlgorithm,
|
|
1275
1275
|
library: {
|
|
1276
1276
|
name: libraryName === '*' ? undefined : libraryName,
|
|
1277
|
-
type:
|
|
1277
|
+
type: configuration.exportFormat.self,
|
|
1278
1278
|
umdNamedDefine: true
|
|
1279
1279
|
},
|
|
1280
|
-
path:
|
|
1281
|
-
publicPath:
|
|
1280
|
+
path: configuration.path.target.base,
|
|
1281
|
+
publicPath: configuration.path.target["public"]
|
|
1282
1282
|
},
|
|
1283
|
-
performance:
|
|
1283
|
+
performance: configuration.performanceHints,
|
|
1284
1284
|
|
|
1285
1285
|
/*
|
|
1286
1286
|
NOTE: Live-reload is not working if target technology is not set to
|
|
1287
1287
|
"web". Webpack boilerplate code may not support target
|
|
1288
1288
|
technologies.
|
|
1289
1289
|
*/
|
|
1290
|
-
target:
|
|
1290
|
+
target: configuration.targetTechnology.boilerplate,
|
|
1291
1291
|
// endregion
|
|
1292
|
-
mode:
|
|
1292
|
+
mode: configuration.debug ? 'development' : 'production',
|
|
1293
1293
|
module: {
|
|
1294
1294
|
rules: _module.additional.pre.map(evaluateAdditionalLoaderConfiguration).concat(loader.ejs, loader.script, loader.html.main, loader.html.ejs, loader.html.html, loader.style, loader.font.eot, loader.font.svg, loader.font.ttf, loader.font.woff, loader.image, loader.data, _module.additional.post.map(evaluateAdditionalLoaderConfiguration))
|
|
1295
1295
|
},
|
|
1296
|
-
node:
|
|
1296
|
+
node: configuration.nodeEnvironment,
|
|
1297
1297
|
optimization: _objectSpread({
|
|
1298
|
-
chunkIds:
|
|
1299
|
-
moduleIds:
|
|
1298
|
+
chunkIds: configuration.debug ? 'named' : 'total-size',
|
|
1299
|
+
moduleIds: configuration.debug ? 'named' : 'size',
|
|
1300
1300
|
// region common chunks
|
|
1301
|
-
splitChunks: !
|
|
1301
|
+
splitChunks: !configuration.injection.chunks || configuration.targetTechnology.payload === 'node' || configuration.givenCommandLineArguments[2] === 'test' ? {
|
|
1302
1302
|
cacheGroups: {
|
|
1303
1303
|
"default": false,
|
|
1304
1304
|
defaultVendors: false
|
|
@@ -1308,7 +1308,7 @@ var webpackConfiguration = _clientnode["default"].extend(true, {
|
|
|
1308
1308
|
cacheGroups: {
|
|
1309
1309
|
defaultVendors: {
|
|
1310
1310
|
chunks: function chunks(chunk) {
|
|
1311
|
-
if ((0, _typeof2["default"])(
|
|
1311
|
+
if ((0, _typeof2["default"])(configuration.inPlace.javaScript) === 'object' && configuration.inPlace.javaScript !== null) for (var _i5 = 0, _Object$keys = Object.keys(configuration.inPlace.javaScript); _i5 < _Object$keys.length; _i5++) {
|
|
1312
1312
|
var _name4 = _Object$keys[_i5];
|
|
1313
1313
|
if (_name4 === '*' || _name4 === chunk.name) return false;
|
|
1314
1314
|
}
|
|
@@ -1319,7 +1319,7 @@ var webpackConfiguration = _clientnode["default"].extend(true, {
|
|
|
1319
1319
|
test: /[\\/]node_modules[\\/]/
|
|
1320
1320
|
}
|
|
1321
1321
|
}
|
|
1322
|
-
},
|
|
1322
|
+
}, configuration.injection.chunks)
|
|
1323
1323
|
}, _clientnode["default"].mask(_module.optimizer, {
|
|
1324
1324
|
exclude: {
|
|
1325
1325
|
babelMinify: true,
|
|
@@ -1331,26 +1331,26 @@ var webpackConfiguration = _clientnode["default"].extend(true, {
|
|
|
1331
1331
|
}
|
|
1332
1332
|
})),
|
|
1333
1333
|
plugins: pluginInstances
|
|
1334
|
-
}, (_configuration$cache2 =
|
|
1335
|
-
cache:
|
|
1336
|
-
} : {},
|
|
1334
|
+
}, (_configuration$cache2 = configuration.cache) !== null && _configuration$cache2 !== void 0 && _configuration$cache2.main ? {
|
|
1335
|
+
cache: configuration.cache.main
|
|
1336
|
+
} : {}, configuration.webpack, customConfiguration);
|
|
1337
1337
|
|
|
1338
1338
|
exports.webpackConfiguration = webpackConfiguration;
|
|
1339
|
-
if (
|
|
1339
|
+
if (configuration.nodeENV !== null) webpackConfiguration.optimization.nodeEnv = configuration.nodeENV;
|
|
1340
1340
|
if (!Array.isArray(_module.skipParseRegularExpressions) || _module.skipParseRegularExpressions.length) webpackConfiguration.module.noParse = _module.skipParseRegularExpressions;
|
|
1341
|
-
if ((_configuration$path$c2 =
|
|
1342
|
-
require.resolve(
|
|
1341
|
+
if ((_configuration$path$c2 = configuration.path.configuration) !== null && _configuration$path$c2 !== void 0 && _configuration$path$c2.javaScript) try {
|
|
1342
|
+
require.resolve(configuration.path.configuration.javaScript);
|
|
1343
1343
|
|
|
1344
|
-
var result = (0, _clientnode.optionalRequire)(
|
|
1344
|
+
var result = (0, _clientnode.optionalRequire)(configuration.path.configuration.javaScript);
|
|
1345
1345
|
if (_clientnode["default"].isPlainObject(result)) {
|
|
1346
1346
|
if (Object.prototype.hasOwnProperty.call(result, 'replaceWebOptimizer')) exports.webpackConfiguration = webpackConfiguration = result.replaceWebOptimizer;else _clientnode["default"].extend(true, webpackConfiguration, result);
|
|
1347
|
-
} else console.debug('Failed to load given JavaScript configuration file path "' + "".concat(
|
|
1347
|
+
} else console.debug('Failed to load given JavaScript configuration file path "' + "".concat(configuration.path.configuration.javaScript, "\"."));
|
|
1348
1348
|
} catch (error) {
|
|
1349
|
-
console.debug('Optional configuration file script "' + "".concat(
|
|
1349
|
+
console.debug('Optional configuration file script "' + "".concat(configuration.path.configuration.javaScript, "\" not available."));
|
|
1350
1350
|
}
|
|
1351
1351
|
|
|
1352
|
-
if (
|
|
1353
|
-
console.info('Using internal configuration:', _util["default"].inspect(
|
|
1352
|
+
if (configuration.showConfiguration) {
|
|
1353
|
+
console.info('Using internal configuration:', _util["default"].inspect(configuration, {
|
|
1354
1354
|
depth: null
|
|
1355
1355
|
}));
|
|
1356
1356
|
console.info('-----------------------------------------------------------');
|