weboptimizer 2.0.1085 → 2.0.1089
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/browser.js +1 -1
- package/configurator.js +21 -28
- package/ejsLoader.d.ts +7 -4
- package/ejsLoader.js +11 -8
- package/helper.d.ts +56 -20
- package/helper.js +77 -48
- package/index.js +25 -25
- package/package.json +33 -21
- package/tsconfig.json +1 -1
- package/type.d.ts +29 -16
- package/type.js +1 -1
- package/webpackConfigurator.js +85 -86
package/webpackConfigurator.js
CHANGED
|
@@ -24,7 +24,7 @@ var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
|
24
24
|
Object.defineProperty(exports, "__esModule", {
|
|
25
25
|
value: true
|
|
26
26
|
});
|
|
27
|
-
exports["default"] =
|
|
27
|
+
exports.webpackConfiguration = exports["default"] = void 0;
|
|
28
28
|
|
|
29
29
|
var _construct2 = _interopRequireDefault(require("@babel/runtime/helpers/construct"));
|
|
30
30
|
|
|
@@ -40,7 +40,7 @@ var _clientnode = _interopRequireWildcard(require("clientnode"));
|
|
|
40
40
|
|
|
41
41
|
var _jsdom = require("jsdom");
|
|
42
42
|
|
|
43
|
-
var _path =
|
|
43
|
+
var _path = require("path");
|
|
44
44
|
|
|
45
45
|
var _util = _interopRequireDefault(require("util"));
|
|
46
46
|
|
|
@@ -123,11 +123,11 @@ var loaderUtilsIsUrlRequestBackup = _loaderUtils["default"].isUrlRequest;
|
|
|
123
123
|
if (require.cache && require.resolve('loader-utils') in require.cache) require.cache[require.resolve('loader-utils')].exports.isUrlRequest = function (url) {
|
|
124
124
|
if (/^[a-z]+:.+/.exec(url)) return false;
|
|
125
125
|
|
|
126
|
-
for (var _len2 = arguments.length,
|
|
127
|
-
|
|
126
|
+
for (var _len2 = arguments.length, parameters = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
127
|
+
parameters[_key2 - 1] = arguments[_key2];
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
return loaderUtilsIsUrlRequestBackup.call.apply(loaderUtilsIsUrlRequestBackup, [_loaderUtils["default"], url].concat(
|
|
130
|
+
return loaderUtilsIsUrlRequestBackup.call.apply(loaderUtilsIsUrlRequestBackup, [_loaderUtils["default"], url].concat(parameters));
|
|
131
131
|
}; // / endregion
|
|
132
132
|
// endregion
|
|
133
133
|
// region initialisation
|
|
@@ -220,7 +220,7 @@ if (htmlAvailable && _configurator["default"].offline && plugins.Offline) {
|
|
|
220
220
|
for (var _i2 = 0, _matches = matches; _i2 < _matches.length; _i2++) {
|
|
221
221
|
var _name2 = _matches[_i2];
|
|
222
222
|
|
|
223
|
-
_configurator["default"].offline.common.excludeChunks.push(_path
|
|
223
|
+
_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, "=*"));
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
}
|
|
@@ -344,11 +344,11 @@ if (htmlAvailable && !['serve', 'test:browser'].includes(_configurator["default"
|
|
|
344
344
|
}); // /// endregion
|
|
345
345
|
// /// region mark empty javaScript modules as dummy
|
|
346
346
|
|
|
347
|
-
if (!(_configurator["default"].needed.javaScript || _configurator["default"].needed.javaScriptExtension || _configurator["default"].needed.typeScript || _configurator["default"].needed.typeScriptExtension)) _configurator["default"].files.compose.javaScript = _path
|
|
347
|
+
if (!(_configurator["default"].needed.javaScript || _configurator["default"].needed.javaScriptExtension || _configurator["default"].needed.typeScript || _configurator["default"].needed.typeScriptExtension)) _configurator["default"].files.compose.javaScript = (0, _path.resolve)(_configurator["default"].path.target.asset.javaScript, '.__dummy__.compiled.js'); // /// endregion
|
|
348
348
|
// /// region extract cascading style sheets
|
|
349
349
|
|
|
350
350
|
if (_configurator["default"].files.compose.cascadingStyleSheet && plugins.MiniCSSExtract) pluginInstances.push(new plugins.MiniCSSExtract({
|
|
351
|
-
filename: _path
|
|
351
|
+
filename: (0, _path.relative)(_configurator["default"].path.target.base, _configurator["default"].files.compose.cascadingStyleSheet)
|
|
352
352
|
})); // /// endregion
|
|
353
353
|
// /// region performs implicit external logic
|
|
354
354
|
|
|
@@ -365,7 +365,7 @@ if (_configurator["default"].injection.external.modules === '__implicit__')
|
|
|
365
365
|
request = _ref.request;
|
|
366
366
|
if (typeof request !== 'string') return callback();
|
|
367
367
|
request = request.replace(/^!+/, '');
|
|
368
|
-
if (request.startsWith('/')) request = _path
|
|
368
|
+
if (request.startsWith('/')) request = (0, _path.relative)(_configurator["default"].path.context, request);
|
|
369
369
|
|
|
370
370
|
var _iterator4 = _createForOfIteratorHelper(_configurator["default"].module.directoryNames),
|
|
371
371
|
_step4;
|
|
@@ -543,7 +543,7 @@ if (htmlAvailable) pluginInstances.push({
|
|
|
543
543
|
|
|
544
544
|
|
|
545
545
|
data.html = dom.serialize().replace(/##\+#\+#\+##/g, '<%').replace(/##-#-#-##/g, '%>').replace(/(<style[^>]*>)[\s\S]*?(<\/style[^>]*>)/gi, function (match, startTag, endTag) {
|
|
546
|
-
return "".concat(startTag).concat(styleContents.shift())
|
|
546
|
+
return "".concat(startTag).concat(styleContents.shift()) + endTag;
|
|
547
547
|
}); // region post compilation
|
|
548
548
|
|
|
549
549
|
var _iterator8 = _createForOfIteratorHelper(_configurator["default"].files.html),
|
|
@@ -627,7 +627,7 @@ try {
|
|
|
627
627
|
}
|
|
628
628
|
|
|
629
629
|
if (_configurator["default"].module.enforceDeduplication) {
|
|
630
|
-
var absoluteContextPath = _path
|
|
630
|
+
var absoluteContextPath = (0, _path.resolve)(_configurator["default"].path.context);
|
|
631
631
|
|
|
632
632
|
var consolidator = function consolidator(result) {
|
|
633
633
|
var targetPath = result.createData.resource;
|
|
@@ -658,7 +658,7 @@ if (_configurator["default"].module.enforceDeduplication) {
|
|
|
658
658
|
try {
|
|
659
659
|
for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
|
|
660
660
|
var pathPrefix = _step11.value;
|
|
661
|
-
if (index > 0) pathPrefixes[index] = _path
|
|
661
|
+
if (index > 0) pathPrefixes[index] = (0, _path.resolve)(pathPrefixes[index - 1], pathPrefix);
|
|
662
662
|
index += 1;
|
|
663
663
|
}
|
|
664
664
|
} catch (err) {
|
|
@@ -669,7 +669,7 @@ if (_configurator["default"].module.enforceDeduplication) {
|
|
|
669
669
|
|
|
670
670
|
pathSuffix = targetPath.replace(/(?:^|.*\/)node_modules\/(.+$)/, '$1');
|
|
671
671
|
} else {
|
|
672
|
-
pathPrefixes = [_path
|
|
672
|
+
pathPrefixes = [(0, _path.resolve)(absoluteContextPath, 'node_modules')]; // Find longest common prefix.
|
|
673
673
|
|
|
674
674
|
var _index = 0;
|
|
675
675
|
|
|
@@ -688,8 +688,7 @@ if (_configurator["default"].module.enforceDeduplication) {
|
|
|
688
688
|
try {
|
|
689
689
|
for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
|
|
690
690
|
var _pathPrefix = _step12.value;
|
|
691
|
-
|
|
692
|
-
var alternateTargetPath = _path["default"].resolve(_pathPrefix, pathSuffix);
|
|
691
|
+
var alternateTargetPath = (0, _path.resolve)(_pathPrefix, pathSuffix);
|
|
693
692
|
|
|
694
693
|
if (_clientnode["default"].isFileSync(alternateTargetPath)) {
|
|
695
694
|
var otherPackageDescriptor = _helper["default"].getClosestPackageDescriptor(alternateTargetPath);
|
|
@@ -746,7 +745,7 @@ new NormalModuleReplacementPlugin(
|
|
|
746
745
|
const isResource:boolean = Boolean(result.createData.resource)
|
|
747
746
|
const targetPath:string = isResource ?
|
|
748
747
|
result.createData.resource :
|
|
749
|
-
|
|
748
|
+
resolve(result.context, result.request)
|
|
750
749
|
if (
|
|
751
750
|
targetPath &&
|
|
752
751
|
/((?:^|\/)node_modules\/.+){2}/.test(targetPath) &&
|
|
@@ -766,7 +765,7 @@ new NormalModuleReplacementPlugin(
|
|
|
766
765
|
for (const pathPrefix of pathPrefixes) {
|
|
767
766
|
if (index > 0)
|
|
768
767
|
pathPrefixes[index] =
|
|
769
|
-
|
|
768
|
+
resolve(pathPrefixes[index - 1], pathPrefix)
|
|
770
769
|
index += 1
|
|
771
770
|
}
|
|
772
771
|
const pathSuffix:string =
|
|
@@ -774,7 +773,7 @@ new NormalModuleReplacementPlugin(
|
|
|
774
773
|
let redundantRequest:null|PlainObject = null
|
|
775
774
|
for (const pathPrefix of pathPrefixes) {
|
|
776
775
|
const alternateTargetPath:string =
|
|
777
|
-
|
|
776
|
+
resolve(pathPrefix, pathSuffix)
|
|
778
777
|
if (Tools.isFileSync(alternateTargetPath)) {
|
|
779
778
|
const otherPackageDescriptor:null|PackageDescriptor =
|
|
780
779
|
Helper.getClosestPackageDescriptor(
|
|
@@ -825,7 +824,7 @@ new NormalModuleReplacementPlugin(
|
|
|
825
824
|
var isFilePathInDependencies = function isFilePathInDependencies(filePath) {
|
|
826
825
|
filePath = _helper["default"].stripLoader(filePath);
|
|
827
826
|
return _helper["default"].isFilePathInLocation(filePath, _configurator["default"].path.ignore.concat(_configurator["default"].module.directoryNames, _configurator["default"].loader.directoryNames).map(function (filePath) {
|
|
828
|
-
return _path
|
|
827
|
+
return (0, _path.resolve)(_configurator["default"].path.context, filePath);
|
|
829
828
|
}).filter(function (filePath) {
|
|
830
829
|
return !_configurator["default"].path.context.startsWith(filePath);
|
|
831
830
|
}));
|
|
@@ -871,7 +870,55 @@ var evaluateAdditionalLoaderConfiguration = function evaluateAdditionalLoaderCon
|
|
|
871
870
|
|
|
872
871
|
var includingPaths = _helper["default"].normalizePaths([_configurator["default"].path.source.asset.javaScript].concat(_configurator["default"].module.locations.directoryPaths));
|
|
873
872
|
|
|
874
|
-
|
|
873
|
+
var cssUse = _configurator["default"].module.preprocessor.cascadingStyleSheet.additional.pre.map(evaluateMapper).concat({
|
|
874
|
+
loader: _configurator["default"].module.style.loader,
|
|
875
|
+
options: _configurator["default"].module.style.options || {}
|
|
876
|
+
}, {
|
|
877
|
+
loader: _configurator["default"].module.cascadingStyleSheet.loader,
|
|
878
|
+
options: _configurator["default"].module.cascadingStyleSheet.options || {}
|
|
879
|
+
}, _configurator["default"].module.preprocessor.cascadingStyleSheet.loader ? {
|
|
880
|
+
loader: _configurator["default"].module.preprocessor.cascadingStyleSheet.loader,
|
|
881
|
+
options: _clientnode["default"].extend(true, (0, _clientnode.optionalRequire)('postcss') ? {
|
|
882
|
+
postcssOptions: {
|
|
883
|
+
plugins: [].concat(postcssImport ? postcssImport({
|
|
884
|
+
root: _configurator["default"].path.context
|
|
885
|
+
}) : [], _configurator["default"].module.preprocessor.cascadingStyleSheet.additional.plugins.pre.map(evaluateMapper),
|
|
886
|
+
/*
|
|
887
|
+
NOTE: Checking path doesn't work if fonts
|
|
888
|
+
are referenced in libraries provided in
|
|
889
|
+
another location than the project itself
|
|
890
|
+
like the "node_modules" folder.
|
|
891
|
+
*/
|
|
892
|
+
postcssFontPath ? postcssFontPath({
|
|
893
|
+
checkPath: false,
|
|
894
|
+
formats: [{
|
|
895
|
+
type: 'woff2',
|
|
896
|
+
ext: 'woff2'
|
|
897
|
+
}, {
|
|
898
|
+
type: 'woff',
|
|
899
|
+
ext: 'woff'
|
|
900
|
+
}]
|
|
901
|
+
}) : [], postcssURL ? postcssURL({
|
|
902
|
+
url: 'rebase'
|
|
903
|
+
}) : [], postcssSprites ? postcssSprites({
|
|
904
|
+
filterBy: function filterBy() {
|
|
905
|
+
return new Promise(function (resolve, reject) {
|
|
906
|
+
return (_configurator["default"].files.compose.image ? resolve : reject)();
|
|
907
|
+
});
|
|
908
|
+
},
|
|
909
|
+
hooks: {
|
|
910
|
+
onSaveSpritesheet: function onSaveSpritesheet(image) {
|
|
911
|
+
return (0, _path.join)(image.spritePath, (0, _path.relative)(_configurator["default"].path.target.asset.image, _configurator["default"].files.compose.image));
|
|
912
|
+
}
|
|
913
|
+
},
|
|
914
|
+
stylesheetPath: _configurator["default"].path.source.asset.cascadingStyleSheet,
|
|
915
|
+
spritePath: _configurator["default"].path.source.asset.image
|
|
916
|
+
}) : [], _configurator["default"].module.preprocessor.cascadingStyleSheet.additional.plugins.post.map(evaluateMapper), _configurator["default"].module.optimizer.cssnano && postcssCSSnano ? postcssCSSnano(_configurator["default"].module.optimizer.cssnano) : [])
|
|
917
|
+
}
|
|
918
|
+
} : {}, _configurator["default"].module.preprocessor.cascadingStyleSheet.options || {})
|
|
919
|
+
} : [], _configurator["default"].module.preprocessor.cascadingStyleSheet.additional.post.map(evaluateMapper));
|
|
920
|
+
|
|
921
|
+
var genericLoader = {
|
|
875
922
|
// Convert to compatible native web types.
|
|
876
923
|
// region generic template
|
|
877
924
|
ejs: {
|
|
@@ -945,7 +992,7 @@ _clientnode["default"].extend(loader, {
|
|
|
945
992
|
include: _configurator["default"].path.source.asset.template,
|
|
946
993
|
test: /\.html\.ejs(?:\?.*)?$/i,
|
|
947
994
|
use: _configurator["default"].module.preprocessor.html.additional.pre.map(evaluateMapper).concat({
|
|
948
|
-
loader: 'file?name=' + _path
|
|
995
|
+
loader: 'file?name=' + (0, _path.join)((0, _path.relative)(_configurator["default"].path.target.asset.base, _configurator["default"].path.target.asset.template), '[name]' + ((_clientnode["default"].isPlainObject(_configurator["default"].module.preprocessor.html.options) ? _configurator["default"].module.preprocessor.html.options : {
|
|
949
996
|
compileSteps: 2
|
|
950
997
|
}).compileSteps % 2 ? '.js' : '') + "?".concat(_configurator["default"].hashAlgorithm, "=[chunkhash]"))
|
|
951
998
|
}, (_clientnode["default"].isPlainObject(_configurator["default"].module.preprocessor.html.options) ? _configurator["default"].module.preprocessor.html.options : {
|
|
@@ -969,7 +1016,7 @@ _clientnode["default"].extend(loader, {
|
|
|
969
1016
|
include: _configurator["default"].path.source.asset.template,
|
|
970
1017
|
test: /\.html(?:\?.*)?$/i,
|
|
971
1018
|
use: _configurator["default"].module.html.additional.pre.map(evaluateMapper).concat({
|
|
972
|
-
loader: 'file?name=' + _path
|
|
1019
|
+
loader: 'file?name=' + (0, _path.join)((0, _path.relative)(_configurator["default"].path.target.base, _configurator["default"].path.target.asset.template), "[name][ext]?".concat(_configurator["default"].hashAlgorithm, "=") + '[chunkhash]')
|
|
973
1020
|
}, {
|
|
974
1021
|
loader: 'extract'
|
|
975
1022
|
}, {
|
|
@@ -1009,54 +1056,7 @@ _clientnode["default"].extend(loader, {
|
|
|
1009
1056
|
return Boolean(result);
|
|
1010
1057
|
},
|
|
1011
1058
|
test: /\.s?css(?:\?.*)?$/i,
|
|
1012
|
-
use:
|
|
1013
|
-
loader: _configurator["default"].module.style.loader,
|
|
1014
|
-
options: _configurator["default"].module.style.options || {}
|
|
1015
|
-
}, {
|
|
1016
|
-
loader: _configurator["default"].module.cascadingStyleSheet.loader,
|
|
1017
|
-
options: _configurator["default"].module.cascadingStyleSheet.options || {}
|
|
1018
|
-
}, _configurator["default"].module.preprocessor.cascadingStyleSheet.loader ? {
|
|
1019
|
-
loader: _configurator["default"].module.preprocessor.cascadingStyleSheet.loader,
|
|
1020
|
-
options: _clientnode["default"].extend(true, (0, _clientnode.optionalRequire)('postcss') ? {
|
|
1021
|
-
postcssOptions: {
|
|
1022
|
-
plugins: [].concat(postcssImport ? postcssImport({
|
|
1023
|
-
root: _configurator["default"].path.context
|
|
1024
|
-
}) : [], _configurator["default"].module.preprocessor.cascadingStyleSheet.additional.plugins.pre.map(evaluateMapper),
|
|
1025
|
-
/*
|
|
1026
|
-
NOTE: Checking path doesn't work if
|
|
1027
|
-
fonts are referenced in libraries
|
|
1028
|
-
provided in another location than
|
|
1029
|
-
the project itself like the
|
|
1030
|
-
"node_modules" folder.
|
|
1031
|
-
*/
|
|
1032
|
-
postcssFontPath ? postcssFontPath({
|
|
1033
|
-
checkPath: false,
|
|
1034
|
-
formats: [{
|
|
1035
|
-
type: 'woff2',
|
|
1036
|
-
ext: 'woff2'
|
|
1037
|
-
}, {
|
|
1038
|
-
type: 'woff',
|
|
1039
|
-
ext: 'woff'
|
|
1040
|
-
}]
|
|
1041
|
-
}) : [], postcssURL ? postcssURL({
|
|
1042
|
-
url: 'rebase'
|
|
1043
|
-
}) : [], postcssSprites ? postcssSprites({
|
|
1044
|
-
filterBy: function filterBy() {
|
|
1045
|
-
return new Promise(function (resolve, reject) {
|
|
1046
|
-
return (_configurator["default"].files.compose.image ? resolve : reject)();
|
|
1047
|
-
});
|
|
1048
|
-
},
|
|
1049
|
-
hooks: {
|
|
1050
|
-
onSaveSpritesheet: function onSaveSpritesheet(image) {
|
|
1051
|
-
return _path["default"].join(image.spritePath, _path["default"].relative(_configurator["default"].path.target.asset.image, _configurator["default"].files.compose.image));
|
|
1052
|
-
}
|
|
1053
|
-
},
|
|
1054
|
-
stylesheetPath: _configurator["default"].path.source.asset.cascadingStyleSheet,
|
|
1055
|
-
spritePath: _configurator["default"].path.source.asset.image
|
|
1056
|
-
}) : [], _configurator["default"].module.preprocessor.cascadingStyleSheet.additional.plugins.post.map(evaluateMapper), _configurator["default"].module.optimizer.cssnano && postcssCSSnano ? postcssCSSnano(_configurator["default"].module.optimizer.cssnano) : [])
|
|
1057
|
-
}
|
|
1058
|
-
} : {}, _configurator["default"].module.preprocessor.cascadingStyleSheet.options || {})
|
|
1059
|
-
} : [], _configurator["default"].module.preprocessor.cascadingStyleSheet.additional.post.map(evaluateMapper))
|
|
1059
|
+
use: cssUse
|
|
1060
1060
|
},
|
|
1061
1061
|
// endregion
|
|
1062
1062
|
// Optimize loaded assets.
|
|
@@ -1067,7 +1067,7 @@ _clientnode["default"].extend(loader, {
|
|
|
1067
1067
|
return _configurator["default"].module.optimizer.font.eot.exclude === null ? false : evaluate(_configurator["default"].module.optimizer.font.eot.exclude, filePath);
|
|
1068
1068
|
},
|
|
1069
1069
|
generator: {
|
|
1070
|
-
filename: _path
|
|
1070
|
+
filename: (0, _path.join)((0, _path.relative)(_configurator["default"].path.target.base, _configurator["default"].path.target.asset.font), '[name][ext]') + "?".concat(_configurator["default"].hashAlgorithm, "=[chunkhash]")
|
|
1071
1071
|
},
|
|
1072
1072
|
test: /\.eot(?:\?.*)?$/i,
|
|
1073
1073
|
type: 'asset/resource',
|
|
@@ -1084,7 +1084,7 @@ _clientnode["default"].extend(loader, {
|
|
|
1084
1084
|
},
|
|
1085
1085
|
include: _configurator["default"].path.source.asset.font,
|
|
1086
1086
|
generator: {
|
|
1087
|
-
filename: _path
|
|
1087
|
+
filename: (0, _path.join)((0, _path.relative)(_configurator["default"].path.target.base, _configurator["default"].path.target.asset.font), '[name][ext]') + "?".concat(_configurator["default"].hashAlgorithm, "=[chunkhash]")
|
|
1088
1088
|
},
|
|
1089
1089
|
mimetype: 'image/svg+xml',
|
|
1090
1090
|
parser: {
|
|
@@ -1101,7 +1101,7 @@ _clientnode["default"].extend(loader, {
|
|
|
1101
1101
|
return _configurator["default"].module.optimizer.font.ttf.exclude === null ? false : evaluate(_configurator["default"].module.optimizer.font.ttf.exclude, filePath);
|
|
1102
1102
|
},
|
|
1103
1103
|
generator: {
|
|
1104
|
-
filename: _path
|
|
1104
|
+
filename: (0, _path.join)((0, _path.relative)(_configurator["default"].path.target.base, _configurator["default"].path.target.asset.font), '[name][ext]') + "?".concat(_configurator["default"].hashAlgorithm, "=[chunkhash]")
|
|
1105
1105
|
},
|
|
1106
1106
|
test: /\.ttf(?:\?.*)?$/i,
|
|
1107
1107
|
type: 'asset/resource',
|
|
@@ -1118,7 +1118,7 @@ _clientnode["default"].extend(loader, {
|
|
|
1118
1118
|
return _configurator["default"].module.optimizer.font.woff.exclude === null ? false : evaluate(_configurator["default"].module.optimizer.font.woff.exclude, filePath);
|
|
1119
1119
|
},
|
|
1120
1120
|
generator: {
|
|
1121
|
-
filename: _path
|
|
1121
|
+
filename: (0, _path.join)((0, _path.relative)(_configurator["default"].path.target.base, _configurator["default"].path.target.asset.font), '[name][ext]') + "?".concat(_configurator["default"].hashAlgorithm, "=[chunkhash]")
|
|
1122
1122
|
},
|
|
1123
1123
|
test: /\.woff2?(?:\?.*)?$/i,
|
|
1124
1124
|
type: 'asset/resource',
|
|
@@ -1137,7 +1137,7 @@ _clientnode["default"].extend(loader, {
|
|
|
1137
1137
|
return _configurator["default"].module.optimizer.image.exclude === null ? isFilePathInDependencies(filePath) : evaluate(_configurator["default"].module.optimizer.image.exclude, filePath);
|
|
1138
1138
|
},
|
|
1139
1139
|
generator: {
|
|
1140
|
-
filename: _path
|
|
1140
|
+
filename: (0, _path.join)((0, _path.relative)(_configurator["default"].path.target.base, _configurator["default"].path.target.asset.image), '[name][ext]') + "?".concat(_configurator["default"].hashAlgorithm, "=[chunkhash]")
|
|
1141
1141
|
},
|
|
1142
1142
|
include: _configurator["default"].path.source.asset.image,
|
|
1143
1143
|
test: /\.(?:gif|ico|jpg|png|svg)(?:\?.*)?$/i,
|
|
@@ -1154,10 +1154,10 @@ _clientnode["default"].extend(loader, {
|
|
|
1154
1154
|
data: {
|
|
1155
1155
|
exclude: function exclude(filePath) {
|
|
1156
1156
|
if (typeof filePath !== 'string') return false;
|
|
1157
|
-
return _configurator["default"].extensions.file.internal.includes(_path
|
|
1157
|
+
return _configurator["default"].extensions.file.internal.includes((0, _path.extname)(_helper["default"].stripLoader(filePath))) || (_configurator["default"].module.optimizer.data.exclude === null ? isFilePathInDependencies(filePath) : evaluate(_configurator["default"].module.optimizer.data.exclude, filePath));
|
|
1158
1158
|
},
|
|
1159
1159
|
generator: {
|
|
1160
|
-
filename: _path
|
|
1160
|
+
filename: (0, _path.join)((0, _path.relative)(_configurator["default"].path.target.base, _configurator["default"].path.target.asset.data), '[name][ext]') + "?".concat(_configurator["default"].hashAlgorithm, "=[chunkhash]")
|
|
1161
1161
|
},
|
|
1162
1162
|
test: /.+/,
|
|
1163
1163
|
type: 'asset/resource',
|
|
@@ -1169,7 +1169,9 @@ _clientnode["default"].extend(loader, {
|
|
|
1169
1169
|
use: _configurator["default"].module.optimizer.data.loader.map(evaluateMapper)
|
|
1170
1170
|
} // endregion
|
|
1171
1171
|
|
|
1172
|
-
}
|
|
1172
|
+
};
|
|
1173
|
+
|
|
1174
|
+
_clientnode["default"].extend(loader, genericLoader);
|
|
1173
1175
|
|
|
1174
1176
|
if (_configurator["default"].files.compose.cascadingStyleSheet && plugins.MiniCSSExtract) {
|
|
1175
1177
|
/*
|
|
@@ -1178,10 +1180,7 @@ if (_configurator["default"].files.compose.cascadingStyleSheet && plugins.MiniCS
|
|
|
1178
1180
|
*/
|
|
1179
1181
|
loader.style.use.shift();
|
|
1180
1182
|
loader.style.use.unshift({
|
|
1181
|
-
loader: plugins.MiniCSSExtract.loader
|
|
1182
|
-
options: {
|
|
1183
|
-
esModule: true
|
|
1184
|
-
}
|
|
1183
|
+
loader: plugins.MiniCSSExtract.loader
|
|
1185
1184
|
});
|
|
1186
1185
|
} // / endregion
|
|
1187
1186
|
// / region apply runtime dev helper
|
|
@@ -1194,7 +1193,7 @@ if (_configurator["default"].files.compose.cascadingStyleSheet && plugins.MiniCS
|
|
|
1194
1193
|
|
|
1195
1194
|
|
|
1196
1195
|
if (htmlAvailable && _configurator["default"].debug && _configurator["default"].development.server.liveReload && !_configurator["default"].injection.entry.normalized.developmentHandler && ['serve', 'test:browser'].includes(_configurator["default"].givenCommandLineArguments[2])) {
|
|
1197
|
-
_configurator["default"].injection.entry.normalized.developmentHandler = ['webpack-dev-server/client/index.js?live-reload=true&hot=' + "".concat(_configurator["default"].development.server.hot ? 'true' : 'false', "&http") + "".concat(_configurator["default"].development.server.https ? 's' : '', "://") + "".concat(_configurator["default"].development.server.host, ":") + _configurator["default"].development.server.port];
|
|
1196
|
+
_configurator["default"].injection.entry.normalized.developmentHandler = ['webpack-dev-server/client/index.js?live-reload=true&hot=' + "".concat(_configurator["default"].development.server.hot ? 'true' : 'false', "&http") + "".concat(_configurator["default"].development.server.https ? 's' : '', "://") + "".concat(_configurator["default"].development.server.host, ":") + "".concat(_configurator["default"].development.server.port)];
|
|
1198
1197
|
|
|
1199
1198
|
if (_configurator["default"].development.server.hot) {
|
|
1200
1199
|
_configurator["default"].injection.entry.normalized.developmentHandler.push('webpack/hot/dev-server.js');
|
|
@@ -1212,7 +1211,7 @@ var _iterator15 = _createForOfIteratorHelper(_configurator["default"].plugins),
|
|
|
1212
1211
|
try {
|
|
1213
1212
|
for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
|
|
1214
1213
|
var pluginConfiguration = _step15.value;
|
|
1215
|
-
pluginInstances.push((0, _construct2["default"])(eval('require')(pluginConfiguration.name.module)[pluginConfiguration.name.initializer], (0, _toConsumableArray2["default"])(pluginConfiguration.
|
|
1214
|
+
pluginInstances.push((0, _construct2["default"])(eval('require')(pluginConfiguration.name.module)[pluginConfiguration.name.initializer], (0, _toConsumableArray2["default"])(pluginConfiguration.parameters)));
|
|
1216
1215
|
} // region configuration
|
|
1217
1216
|
|
|
1218
1217
|
} catch (err) {
|
|
@@ -1267,8 +1266,8 @@ var webpackConfiguration = _clientnode["default"].extend(true, {
|
|
|
1267
1266
|
// endregion
|
|
1268
1267
|
// region output
|
|
1269
1268
|
output: {
|
|
1270
|
-
assetModuleFilename: _path
|
|
1271
|
-
filename: _path
|
|
1269
|
+
assetModuleFilename: (0, _path.join)((0, _path.relative)(_configurator["default"].path.target.base, _configurator["default"].path.target.asset.base), '[name][ext]') + "?".concat(_configurator["default"].hashAlgorithm, "=[chunkhash]"),
|
|
1270
|
+
filename: (0, _path.relative)(_configurator["default"].path.target.base, _configurator["default"].files.compose.javaScript),
|
|
1272
1271
|
globalObject: _configurator["default"].exportFormat.globalObject,
|
|
1273
1272
|
hashFunction: _configurator["default"].hashAlgorithm,
|
|
1274
1273
|
library: libraryName === '*' ? undefined : libraryName,
|