webpack 5.79.0 → 5.80.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.
Potentially problematic release.
This version of webpack might be problematic. Click here for more details.
- package/README.md +3 -0
- package/lib/NormalModuleFactory.js +11 -1
- package/lib/WarnCaseSensitiveModulesPlugin.js +12 -0
- package/lib/asset/AssetGenerator.js +11 -3
- package/lib/css/CssParser.js +109 -14
- package/lib/css/walkCssTokens.js +129 -74
- package/lib/dependencies/CssUrlDependency.js +30 -18
- package/lib/dependencies/ImportMetaPlugin.js +56 -26
- package/lib/dependencies/ImportParserPlugin.js +17 -1
- package/lib/ids/OccurrenceModuleIdsPlugin.js +1 -1
- package/lib/javascript/JavascriptParser.js +13 -3
- package/lib/schemes/DataUriPlugin.js +12 -3
- package/lib/stats/DefaultStatsFactoryPlugin.js +98 -25
- package/lib/stats/DefaultStatsPresetPlugin.js +9 -0
- package/lib/stats/DefaultStatsPrinterPlugin.js +4 -0
- package/package.json +16 -18
- package/schemas/WebpackOptions.check.js +1 -1
- package/schemas/WebpackOptions.json +8 -0
- package/types.d.ts +53 -17
@@ -27,12 +27,12 @@ class CssUrlDependency extends ModuleDependency {
|
|
27
27
|
/**
|
28
28
|
* @param {string} request request
|
29
29
|
* @param {[number, number]} range range of the argument
|
30
|
-
* @param {string
|
30
|
+
* @param {"string" | "url"} urlType dependency type e.g. url() or string
|
31
31
|
*/
|
32
|
-
constructor(request, range,
|
32
|
+
constructor(request, range, urlType) {
|
33
33
|
super(request);
|
34
34
|
this.range = range;
|
35
|
-
this.
|
35
|
+
this.urlType = urlType;
|
36
36
|
}
|
37
37
|
|
38
38
|
get type() {
|
@@ -54,13 +54,13 @@ class CssUrlDependency extends ModuleDependency {
|
|
54
54
|
|
55
55
|
serialize(context) {
|
56
56
|
const { write } = context;
|
57
|
-
write(this.
|
57
|
+
write(this.urlType);
|
58
58
|
super.serialize(context);
|
59
59
|
}
|
60
60
|
|
61
61
|
deserialize(context) {
|
62
62
|
const { read } = context;
|
63
|
-
this.
|
63
|
+
this.urlType = read();
|
64
64
|
super.deserialize(context);
|
65
65
|
}
|
66
66
|
}
|
@@ -108,22 +108,34 @@ CssUrlDependency.Template = class CssUrlDependencyTemplate extends (
|
|
108
108
|
apply(
|
109
109
|
dependency,
|
110
110
|
source,
|
111
|
-
{
|
111
|
+
{ moduleGraph, runtimeTemplate, codeGenerationResults }
|
112
112
|
) {
|
113
113
|
const dep = /** @type {CssUrlDependency} */ (dependency);
|
114
114
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
115
|
+
let newValue;
|
116
|
+
|
117
|
+
switch (dep.urlType) {
|
118
|
+
case "string":
|
119
|
+
newValue = cssEscapeString(
|
120
|
+
runtimeTemplate.assetUrl({
|
121
|
+
publicPath: "",
|
122
|
+
module: moduleGraph.getModule(dep),
|
123
|
+
codeGenerationResults
|
124
|
+
})
|
125
|
+
);
|
126
|
+
break;
|
127
|
+
case "url":
|
128
|
+
newValue = `url(${cssEscapeString(
|
129
|
+
runtimeTemplate.assetUrl({
|
130
|
+
publicPath: "",
|
131
|
+
module: moduleGraph.getModule(dep),
|
132
|
+
codeGenerationResults
|
133
|
+
})
|
134
|
+
)})`;
|
135
|
+
break;
|
136
|
+
}
|
137
|
+
|
138
|
+
source.replace(dep.range[0], dep.range[1] - 1, newValue);
|
127
139
|
}
|
128
140
|
};
|
129
141
|
|
@@ -75,6 +75,17 @@ class ImportMetaPlugin {
|
|
75
75
|
}
|
76
76
|
|
77
77
|
/// import.meta direct ///
|
78
|
+
const webpackVersion = parseInt(
|
79
|
+
require("../../package.json").version,
|
80
|
+
10
|
81
|
+
);
|
82
|
+
const importMetaUrl = () =>
|
83
|
+
JSON.stringify(getUrl(parser.state.module));
|
84
|
+
const importMetaWebpackVersion = () => JSON.stringify(webpackVersion);
|
85
|
+
const importMetaUnknownProperty = members =>
|
86
|
+
`${Template.toNormalComment(
|
87
|
+
"unsupported import.meta." + members.join(".")
|
88
|
+
)} undefined${propertyAccess(members, 1)}`;
|
78
89
|
parser.hooks.typeof
|
79
90
|
.for("import.meta")
|
80
91
|
.tap(
|
@@ -84,20 +95,48 @@ class ImportMetaPlugin {
|
|
84
95
|
parser.hooks.expression
|
85
96
|
.for("import.meta")
|
86
97
|
.tap(PLUGIN_NAME, metaProperty => {
|
87
|
-
const
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
98
|
+
const referencedPropertiesInDestructuring =
|
99
|
+
parser.destructuringAssignmentPropertiesFor(metaProperty);
|
100
|
+
if (!referencedPropertiesInDestructuring) {
|
101
|
+
const CriticalDependencyWarning =
|
102
|
+
getCriticalDependencyWarning();
|
103
|
+
parser.state.module.addWarning(
|
104
|
+
new ModuleDependencyWarning(
|
105
|
+
parser.state.module,
|
106
|
+
new CriticalDependencyWarning(
|
107
|
+
"Accessing import.meta directly is unsupported (only property access or destructuring is supported)"
|
108
|
+
),
|
109
|
+
metaProperty.loc
|
110
|
+
)
|
111
|
+
);
|
112
|
+
const dep = new ConstDependency(
|
113
|
+
`${
|
114
|
+
parser.isAsiPosition(metaProperty.range[0]) ? ";" : ""
|
115
|
+
}({})`,
|
116
|
+
metaProperty.range
|
117
|
+
);
|
118
|
+
dep.loc = metaProperty.loc;
|
119
|
+
parser.state.module.addPresentationalDependency(dep);
|
120
|
+
return true;
|
121
|
+
}
|
122
|
+
|
123
|
+
let str = "";
|
124
|
+
for (const prop of referencedPropertiesInDestructuring) {
|
125
|
+
switch (prop) {
|
126
|
+
case "url":
|
127
|
+
str += `url: ${importMetaUrl()},`;
|
128
|
+
break;
|
129
|
+
case "webpack":
|
130
|
+
str += `webpack: ${importMetaWebpackVersion()},`;
|
131
|
+
break;
|
132
|
+
default:
|
133
|
+
str += `[${JSON.stringify(
|
134
|
+
prop
|
135
|
+
)}]: ${importMetaUnknownProperty([prop])},`;
|
136
|
+
break;
|
137
|
+
}
|
138
|
+
}
|
139
|
+
const dep = new ConstDependency(`({${str}})`, metaProperty.range);
|
101
140
|
dep.loc = metaProperty.loc;
|
102
141
|
parser.state.module.addPresentationalDependency(dep);
|
103
142
|
return true;
|
@@ -120,10 +159,7 @@ class ImportMetaPlugin {
|
|
120
159
|
parser.hooks.expression
|
121
160
|
.for("import.meta.url")
|
122
161
|
.tap(PLUGIN_NAME, expr => {
|
123
|
-
const dep = new ConstDependency(
|
124
|
-
JSON.stringify(getUrl(parser.state.module)),
|
125
|
-
expr.range
|
126
|
-
);
|
162
|
+
const dep = new ConstDependency(importMetaUrl(), expr.range);
|
127
163
|
dep.loc = expr.loc;
|
128
164
|
parser.state.module.addPresentationalDependency(dep);
|
129
165
|
return true;
|
@@ -140,10 +176,6 @@ class ImportMetaPlugin {
|
|
140
176
|
});
|
141
177
|
|
142
178
|
/// import.meta.webpack ///
|
143
|
-
const webpackVersion = parseInt(
|
144
|
-
require("../../package.json").version,
|
145
|
-
10
|
146
|
-
);
|
147
179
|
parser.hooks.typeof
|
148
180
|
.for("import.meta.webpack")
|
149
181
|
.tap(
|
@@ -154,7 +186,7 @@ class ImportMetaPlugin {
|
|
154
186
|
.for("import.meta.webpack")
|
155
187
|
.tap(
|
156
188
|
PLUGIN_NAME,
|
157
|
-
toConstantDependency(parser,
|
189
|
+
toConstantDependency(parser, importMetaWebpackVersion())
|
158
190
|
);
|
159
191
|
parser.hooks.evaluateTypeof
|
160
192
|
.for("import.meta.webpack")
|
@@ -168,9 +200,7 @@ class ImportMetaPlugin {
|
|
168
200
|
.for("import.meta")
|
169
201
|
.tap(PLUGIN_NAME, (expr, members) => {
|
170
202
|
const dep = new ConstDependency(
|
171
|
-
|
172
|
-
"unsupported import.meta." + members.join(".")
|
173
|
-
)} undefined${propertyAccess(members, 1)}`,
|
203
|
+
importMetaUnknownProperty(members),
|
174
204
|
expr.range
|
175
205
|
);
|
176
206
|
dep.loc = expr.loc;
|
@@ -27,6 +27,8 @@ class ImportParserPlugin {
|
|
27
27
|
}
|
28
28
|
|
29
29
|
apply(parser) {
|
30
|
+
const exportsFromEnumerable = enumerable =>
|
31
|
+
Array.from(enumerable, e => [e]);
|
30
32
|
parser.hooks.importCall.tap("ImportParserPlugin", expr => {
|
31
33
|
const param = parser.evaluateExpression(expr.source);
|
32
34
|
|
@@ -184,7 +186,7 @@ class ImportParserPlugin {
|
|
184
186
|
if (typeof importOptions.webpackExports === "string") {
|
185
187
|
exports = [[importOptions.webpackExports]];
|
186
188
|
} else {
|
187
|
-
exports =
|
189
|
+
exports = exportsFromEnumerable(importOptions.webpackExports);
|
188
190
|
}
|
189
191
|
}
|
190
192
|
}
|
@@ -205,6 +207,20 @@ class ImportParserPlugin {
|
|
205
207
|
mode = "lazy";
|
206
208
|
}
|
207
209
|
|
210
|
+
const referencedPropertiesInDestructuring =
|
211
|
+
parser.destructuringAssignmentPropertiesFor(expr);
|
212
|
+
if (referencedPropertiesInDestructuring) {
|
213
|
+
if (exports) {
|
214
|
+
parser.state.module.addWarning(
|
215
|
+
new UnsupportedFeatureWarning(
|
216
|
+
`\`webpackExports\` could not be used with destructuring assignment.`,
|
217
|
+
expr.loc
|
218
|
+
)
|
219
|
+
);
|
220
|
+
}
|
221
|
+
exports = exportsFromEnumerable(referencedPropertiesInDestructuring);
|
222
|
+
}
|
223
|
+
|
208
224
|
if (param.isString()) {
|
209
225
|
if (mode === "eager") {
|
210
226
|
const dep = new ImportEagerDependency(
|
@@ -81,7 +81,7 @@ class OccurrenceModuleIdsPlugin {
|
|
81
81
|
] of moduleGraph.getIncomingConnectionsByOriginModule(module)) {
|
82
82
|
if (!originModule) continue;
|
83
83
|
if (!connections.some(c => c.isTargetActive(undefined))) continue;
|
84
|
-
sum += initialChunkChunkMap.get(originModule);
|
84
|
+
sum += initialChunkChunkMap.get(originModule) || 0;
|
85
85
|
}
|
86
86
|
return sum;
|
87
87
|
};
|
@@ -1743,7 +1743,7 @@ class JavascriptParser extends Parser {
|
|
1743
1743
|
preWalkTryStatement(statement) {
|
1744
1744
|
this.preWalkStatement(statement.block);
|
1745
1745
|
if (statement.handler) this.preWalkCatchClause(statement.handler);
|
1746
|
-
if (statement.
|
1746
|
+
if (statement.finalizer) this.preWalkStatement(statement.finalizer);
|
1747
1747
|
}
|
1748
1748
|
|
1749
1749
|
walkTryStatement(statement) {
|
@@ -1927,7 +1927,12 @@ class JavascriptParser extends Parser {
|
|
1927
1927
|
for (const id of set) keys.add(id);
|
1928
1928
|
}
|
1929
1929
|
|
1930
|
-
this.destructuringAssignmentProperties.set(
|
1930
|
+
this.destructuringAssignmentProperties.set(
|
1931
|
+
expression.right.type === "AwaitExpression"
|
1932
|
+
? expression.right.argument
|
1933
|
+
: expression.right,
|
1934
|
+
keys
|
1935
|
+
);
|
1931
1936
|
|
1932
1937
|
if (expression.right.type === "AssignmentExpression") {
|
1933
1938
|
this.preWalkAssignmentExpression(expression.right);
|
@@ -2183,7 +2188,12 @@ class JavascriptParser extends Parser {
|
|
2183
2188
|
const keys = this._preWalkObjectPattern(declarator.id);
|
2184
2189
|
|
2185
2190
|
if (!keys) return;
|
2186
|
-
this.destructuringAssignmentProperties.set(
|
2191
|
+
this.destructuringAssignmentProperties.set(
|
2192
|
+
declarator.init.type === "AwaitExpression"
|
2193
|
+
? declarator.init.argument
|
2194
|
+
: declarator.init,
|
2195
|
+
keys
|
2196
|
+
);
|
2187
2197
|
|
2188
2198
|
if (declarator.init.type === "AssignmentExpression") {
|
2189
2199
|
this.preWalkAssignmentExpression(declarator.init);
|
@@ -19,9 +19,18 @@ const decodeDataURI = uri => {
|
|
19
19
|
|
20
20
|
const isBase64 = match[3];
|
21
21
|
const body = match[4];
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
|
23
|
+
if (isBase64) {
|
24
|
+
return Buffer.from(body, "base64");
|
25
|
+
}
|
26
|
+
|
27
|
+
// CSS allows to use `data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" style="stroke: rgb(223,224,225); stroke-width: 2px; fill: none; stroke-dasharray: 6px 3px" /></svg>`
|
28
|
+
// so we return original body if we can't `decodeURIComponent`
|
29
|
+
try {
|
30
|
+
return Buffer.from(decodeURIComponent(body), "ascii");
|
31
|
+
} catch (_) {
|
32
|
+
return Buffer.from(body, "ascii");
|
33
|
+
}
|
25
34
|
};
|
26
35
|
|
27
36
|
class DataUriPlugin {
|
@@ -811,11 +811,32 @@ const SIMPLE_EXTRACTORS = {
|
|
811
811
|
},
|
812
812
|
errors: (object, compilation, context, options, factory) => {
|
813
813
|
const { type, cachedGetErrors } = context;
|
814
|
-
|
814
|
+
const rawErrors = cachedGetErrors(compilation);
|
815
|
+
const factorizedErrors = factory.create(
|
815
816
|
`${type}.errors`,
|
816
817
|
cachedGetErrors(compilation),
|
817
818
|
context
|
818
819
|
);
|
820
|
+
let filtered = 0;
|
821
|
+
if (options.errorDetails === "auto" && rawErrors.length >= 3) {
|
822
|
+
filtered = rawErrors
|
823
|
+
.map(e => typeof e !== "string" && e.details)
|
824
|
+
.filter(Boolean).length;
|
825
|
+
}
|
826
|
+
if (
|
827
|
+
options.errorDetails === true ||
|
828
|
+
!Number.isFinite(options.errorsSpace)
|
829
|
+
) {
|
830
|
+
object.errors = factorizedErrors;
|
831
|
+
if (filtered) object.filteredErrorDetailsCount = filtered;
|
832
|
+
return;
|
833
|
+
}
|
834
|
+
const [errors, filteredBySpace] = errorsSpaceLimit(
|
835
|
+
factorizedErrors,
|
836
|
+
options.errorsSpace
|
837
|
+
);
|
838
|
+
object.filteredErrorDetailsCount = filtered + filteredBySpace;
|
839
|
+
object.errors = errors;
|
819
840
|
},
|
820
841
|
errorsCount: (object, compilation, { cachedGetErrors }) => {
|
821
842
|
object.errorsCount = countWithChildren(compilation, c =>
|
@@ -824,11 +845,31 @@ const SIMPLE_EXTRACTORS = {
|
|
824
845
|
},
|
825
846
|
warnings: (object, compilation, context, options, factory) => {
|
826
847
|
const { type, cachedGetWarnings } = context;
|
827
|
-
|
848
|
+
const rawWarnings = factory.create(
|
828
849
|
`${type}.warnings`,
|
829
850
|
cachedGetWarnings(compilation),
|
830
851
|
context
|
831
852
|
);
|
853
|
+
let filtered = 0;
|
854
|
+
if (options.errorDetails === "auto") {
|
855
|
+
filtered = cachedGetWarnings(compilation)
|
856
|
+
.map(e => typeof e !== "string" && e.details)
|
857
|
+
.filter(Boolean).length;
|
858
|
+
}
|
859
|
+
if (
|
860
|
+
options.errorDetails === true ||
|
861
|
+
!Number.isFinite(options.warningsSpace)
|
862
|
+
) {
|
863
|
+
object.warnings = rawWarnings;
|
864
|
+
if (filtered) object.filteredWarningDetailsCount = filtered;
|
865
|
+
return;
|
866
|
+
}
|
867
|
+
const [warnings, filteredBySpace] = errorsSpaceLimit(
|
868
|
+
rawWarnings,
|
869
|
+
options.warningsSpace
|
870
|
+
);
|
871
|
+
object.filteredWarningDetailsCount = filtered + filteredBySpace;
|
872
|
+
object.warnings = warnings;
|
832
873
|
},
|
833
874
|
warningsCount: (
|
834
875
|
object,
|
@@ -853,29 +894,6 @@ const SIMPLE_EXTRACTORS = {
|
|
853
894
|
});
|
854
895
|
});
|
855
896
|
},
|
856
|
-
errorDetails: (
|
857
|
-
object,
|
858
|
-
compilation,
|
859
|
-
{ cachedGetErrors, cachedGetWarnings },
|
860
|
-
{ errorDetails, errors, warnings }
|
861
|
-
) => {
|
862
|
-
if (errorDetails === "auto") {
|
863
|
-
if (warnings) {
|
864
|
-
const warnings = cachedGetWarnings(compilation);
|
865
|
-
object.filteredWarningDetailsCount = warnings
|
866
|
-
.map(e => typeof e !== "string" && e.details)
|
867
|
-
.filter(Boolean).length;
|
868
|
-
}
|
869
|
-
if (errors) {
|
870
|
-
const errors = cachedGetErrors(compilation);
|
871
|
-
if (errors.length >= 3) {
|
872
|
-
object.filteredErrorDetailsCount = errors
|
873
|
-
.map(e => typeof e !== "string" && e.details)
|
874
|
-
.filter(Boolean).length;
|
875
|
-
}
|
876
|
-
}
|
877
|
-
}
|
878
|
-
},
|
879
897
|
children: (object, compilation, context, options, factory) => {
|
880
898
|
const { type } = context;
|
881
899
|
object.children = factory.create(
|
@@ -1779,6 +1797,61 @@ const spaceLimited = (
|
|
1779
1797
|
};
|
1780
1798
|
};
|
1781
1799
|
|
1800
|
+
const errorsSpaceLimit = (errors, max) => {
|
1801
|
+
let filtered = 0;
|
1802
|
+
// Can not fit into limit
|
1803
|
+
// print only messages
|
1804
|
+
if (errors.length + 1 >= max)
|
1805
|
+
return [
|
1806
|
+
errors.map(error => {
|
1807
|
+
if (typeof error === "string" || !error.details) return error;
|
1808
|
+
filtered++;
|
1809
|
+
return { ...error, details: "" };
|
1810
|
+
}),
|
1811
|
+
filtered
|
1812
|
+
];
|
1813
|
+
let fullLength = errors.length;
|
1814
|
+
let result = errors;
|
1815
|
+
|
1816
|
+
let i = 0;
|
1817
|
+
for (; i < errors.length; i++) {
|
1818
|
+
const error = errors[i];
|
1819
|
+
if (typeof error !== "string" && error.details) {
|
1820
|
+
const splitted = error.details.split("\n");
|
1821
|
+
const len = splitted.length;
|
1822
|
+
fullLength += len;
|
1823
|
+
if (fullLength > max) {
|
1824
|
+
result = i > 0 ? errors.slice(0, i) : [];
|
1825
|
+
const overLimit = fullLength - max + 1;
|
1826
|
+
const error = errors[i++];
|
1827
|
+
result.push({
|
1828
|
+
...error,
|
1829
|
+
details: error.details.split("\n").slice(0, -overLimit).join("\n"),
|
1830
|
+
filteredDetails: overLimit
|
1831
|
+
});
|
1832
|
+
filtered = errors.length - i;
|
1833
|
+
for (; i < errors.length; i++) {
|
1834
|
+
const error = errors[i];
|
1835
|
+
if (typeof error === "string" || !error.details) result.push(error);
|
1836
|
+
result.push({ ...error, details: "" });
|
1837
|
+
}
|
1838
|
+
break;
|
1839
|
+
} else if (fullLength === max) {
|
1840
|
+
result = errors.slice(0, ++i);
|
1841
|
+
filtered = errors.length - i;
|
1842
|
+
for (; i < errors.length; i++) {
|
1843
|
+
const error = errors[i];
|
1844
|
+
if (typeof error === "string" || !error.details) result.push(error);
|
1845
|
+
result.push({ ...error, details: "" });
|
1846
|
+
}
|
1847
|
+
break;
|
1848
|
+
}
|
1849
|
+
}
|
1850
|
+
}
|
1851
|
+
|
1852
|
+
return [result, filtered];
|
1853
|
+
};
|
1854
|
+
|
1782
1855
|
const assetGroup = (children, assets) => {
|
1783
1856
|
let size = 0;
|
1784
1857
|
for (const asset of children) {
|
@@ -47,6 +47,8 @@ const NAMED_PRESETS = {
|
|
47
47
|
orphanModules: true,
|
48
48
|
runtimeModules: true,
|
49
49
|
exclude: false,
|
50
|
+
errorsSpace: Infinity,
|
51
|
+
warningsSpace: Infinity,
|
50
52
|
modulesSpace: Infinity,
|
51
53
|
chunkModulesSpace: Infinity,
|
52
54
|
assetsSpace: Infinity,
|
@@ -73,6 +75,8 @@ const NAMED_PRESETS = {
|
|
73
75
|
logging: true,
|
74
76
|
runtimeModules: true,
|
75
77
|
exclude: false,
|
78
|
+
errorsSpace: 1000,
|
79
|
+
warningsSpace: 1000,
|
76
80
|
modulesSpace: 1000,
|
77
81
|
assetsSpace: 1000,
|
78
82
|
reasonsSpace: 1000
|
@@ -82,6 +86,8 @@ const NAMED_PRESETS = {
|
|
82
86
|
version: true,
|
83
87
|
timings: true,
|
84
88
|
modules: true,
|
89
|
+
errorsSpace: 0,
|
90
|
+
warningsSpace: 0,
|
85
91
|
modulesSpace: 0,
|
86
92
|
assets: true,
|
87
93
|
assetsSpace: 0,
|
@@ -95,6 +101,7 @@ const NAMED_PRESETS = {
|
|
95
101
|
all: false,
|
96
102
|
errors: true,
|
97
103
|
errorsCount: true,
|
104
|
+
errorsSpace: Infinity,
|
98
105
|
moduleTrace: true,
|
99
106
|
logging: "error"
|
100
107
|
},
|
@@ -102,8 +109,10 @@ const NAMED_PRESETS = {
|
|
102
109
|
all: false,
|
103
110
|
errors: true,
|
104
111
|
errorsCount: true,
|
112
|
+
errorsSpace: Infinity,
|
105
113
|
warnings: true,
|
106
114
|
warningsCount: true,
|
115
|
+
warningsSpace: Infinity,
|
107
116
|
logging: "warn"
|
108
117
|
},
|
109
118
|
summary: {
|
@@ -603,6 +603,8 @@ const SIMPLE_PRINTERS = {
|
|
603
603
|
"error.message": (message, { bold, formatError }) =>
|
604
604
|
message.includes("\u001b[") ? message : bold(formatError(message)),
|
605
605
|
"error.details": (details, { formatError }) => formatError(details),
|
606
|
+
"error.filteredDetails": filteredDetails =>
|
607
|
+
filteredDetails ? `+ ${filteredDetails} hidden lines` : undefined,
|
606
608
|
"error.stack": stack => stack,
|
607
609
|
"error.moduleTrace": moduleTrace => undefined,
|
608
610
|
"error.separator!": () => "\n",
|
@@ -703,6 +705,8 @@ const ERROR_PREFERRED_ORDER = [
|
|
703
705
|
"separator!",
|
704
706
|
"details",
|
705
707
|
"separator!",
|
708
|
+
"filteredDetails",
|
709
|
+
"separator!",
|
706
710
|
"stack",
|
707
711
|
"separator!",
|
708
712
|
"missing",
|
package/package.json
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
{
|
2
2
|
"name": "webpack",
|
3
|
-
"version": "5.
|
3
|
+
"version": "5.80.0",
|
4
4
|
"author": "Tobias Koppers @sokra",
|
5
5
|
"description": "Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
|
6
6
|
"license": "MIT",
|
7
7
|
"dependencies": {
|
8
8
|
"@types/eslint-scope": "^3.7.3",
|
9
9
|
"@types/estree": "^1.0.0",
|
10
|
-
"@webassemblyjs/ast": "1.11.
|
11
|
-
"@webassemblyjs/wasm-edit": "1.11.
|
12
|
-
"@webassemblyjs/wasm-parser": "1.11.
|
10
|
+
"@webassemblyjs/ast": "^1.11.5",
|
11
|
+
"@webassemblyjs/wasm-edit": "^1.11.5",
|
12
|
+
"@webassemblyjs/wasm-parser": "^1.11.5",
|
13
13
|
"acorn": "^8.7.1",
|
14
14
|
"acorn-import-assertions": "^1.7.6",
|
15
15
|
"browserslist": "^4.14.5",
|
16
16
|
"chrome-trace-event": "^1.0.2",
|
17
|
-
"enhanced-resolve": "^5.
|
17
|
+
"enhanced-resolve": "^5.13.0",
|
18
18
|
"es-module-lexer": "^1.2.1",
|
19
19
|
"eslint-scope": "5.1.1",
|
20
20
|
"events": "^3.2.0",
|
@@ -24,7 +24,7 @@
|
|
24
24
|
"loader-runner": "^4.2.0",
|
25
25
|
"mime-types": "^2.1.27",
|
26
26
|
"neo-async": "^2.6.2",
|
27
|
-
"schema-utils": "^3.1.
|
27
|
+
"schema-utils": "^3.1.2",
|
28
28
|
"tapable": "^2.1.1",
|
29
29
|
"terser-webpack-plugin": "^5.3.7",
|
30
30
|
"watchpack": "^2.4.0",
|
@@ -38,10 +38,9 @@
|
|
38
38
|
"devDependencies": {
|
39
39
|
"@babel/core": "^7.21.4",
|
40
40
|
"@babel/preset-react": "^7.18.6",
|
41
|
-
"@types/es-module-lexer": "^0.4.1",
|
42
41
|
"@types/jest": "^29.5.0",
|
43
42
|
"@types/node": "^18.15.11",
|
44
|
-
"assemblyscript": "^0.
|
43
|
+
"assemblyscript": "^0.27.2",
|
45
44
|
"babel-loader": "^8.1.0",
|
46
45
|
"benchmark": "^2.1.4",
|
47
46
|
"bundle-loader": "^0.5.6",
|
@@ -71,7 +70,7 @@
|
|
71
70
|
"jest-cli": "^29.5.0",
|
72
71
|
"jest-diff": "^29.5.0",
|
73
72
|
"jest-environment-node": "^29.5.0",
|
74
|
-
"jest-junit": "^
|
73
|
+
"jest-junit": "^16.0.0",
|
75
74
|
"json-loader": "^0.5.7",
|
76
75
|
"json5": "^2.1.3",
|
77
76
|
"less": "^4.0.0",
|
@@ -103,7 +102,7 @@
|
|
103
102
|
"ts-loader": "^9.4.2",
|
104
103
|
"typescript": "^4.8.4",
|
105
104
|
"url-loader": "^4.1.0",
|
106
|
-
"wast-loader": "^1.11.
|
105
|
+
"wast-loader": "^1.11.5",
|
107
106
|
"webassembly-feature": "1.3.0",
|
108
107
|
"webpack-cli": "^5.0.1",
|
109
108
|
"xxhashjs": "^0.2.2",
|
@@ -150,7 +149,7 @@
|
|
150
149
|
"pretest": "yarn lint",
|
151
150
|
"prelint": "yarn setup",
|
152
151
|
"lint": "yarn code-lint && yarn special-lint && yarn type-lint && yarn typings-test && yarn module-typings-test && yarn yarn-lint && yarn pretty-lint && yarn spellcheck",
|
153
|
-
"code-lint": "eslint
|
152
|
+
"code-lint": "eslint --cache .",
|
154
153
|
"type-lint": "tsc",
|
155
154
|
"typings-test": "tsc -p tsconfig.types.test.json",
|
156
155
|
"module-typings-test": "tsc -p tsconfig.module.test.json",
|
@@ -159,9 +158,8 @@
|
|
159
158
|
"special-lint-fix": "node node_modules/tooling/inherit-types --write && node node_modules/tooling/format-schemas --write && node tooling/generate-runtime-code.js --write && node tooling/generate-wasm-code.js --write && node node_modules/tooling/format-file-header --write && node node_modules/tooling/compile-to-definitions --write && node node_modules/tooling/precompile-schemas --write && node node_modules/tooling/generate-types --no-template-literals --write",
|
160
159
|
"fix": "yarn code-lint --fix && yarn special-lint-fix && yarn pretty-lint-fix",
|
161
160
|
"prepare": "husky install",
|
162
|
-
"pretty-lint-base": "prettier
|
163
|
-
"pretty-lint-
|
164
|
-
"pretty-lint-fix": "yarn pretty-lint-base-all --loglevel warn --write",
|
161
|
+
"pretty-lint-base": "prettier --cache .",
|
162
|
+
"pretty-lint-fix": "yarn pretty-lint-base --loglevel warn --write",
|
165
163
|
"pretty-lint": "yarn pretty-lint-base --check",
|
166
164
|
"yarn-lint": "yarn-deduplicate --fail --list -s highest yarn.lock",
|
167
165
|
"yarn-lint-fix": "yarn-deduplicate -s highest yarn.lock",
|
@@ -179,11 +177,11 @@
|
|
179
177
|
"cover:report": "nyc report -t coverage"
|
180
178
|
},
|
181
179
|
"lint-staged": {
|
182
|
-
"*.js
|
183
|
-
"eslint --cache"
|
180
|
+
"*.{js,cjs,mjs}": [
|
181
|
+
"eslint --cache --fix"
|
184
182
|
],
|
185
|
-
"
|
186
|
-
"prettier --
|
183
|
+
"*": [
|
184
|
+
"prettier --cache --ignore-unknown"
|
187
185
|
],
|
188
186
|
"*.md|{.github,benchmark,bin,examples,hot,lib,schemas,setup,tooling}/**/*.{md,yml,yaml,js,json}": [
|
189
187
|
"cspell"
|