mirror of https://github.com/webpack/webpack.git
print warning for large serialized strings
This commit is contained in:
parent
81d413a175
commit
6eb9958643
|
|
@ -177,6 +177,16 @@ class BinaryMiddleware extends SerializerMiddleware {
|
|||
}
|
||||
currentBuffer.write(thing, currentPosition);
|
||||
currentPosition += len;
|
||||
if (len > 102400 && context.logger) {
|
||||
context.logger.warn(
|
||||
`Serializing big strings (${Math.round(
|
||||
len / 1024
|
||||
)}kiB) impacts deserialization performance (consider Buffer instead): ${thing.slice(
|
||||
0,
|
||||
100
|
||||
)}...\n`
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "number": {
|
||||
|
|
|
|||
Loading…
Reference in New Issue