mirror of https://github.com/webpack/webpack.git
avoid references for single char strings
This commit is contained in:
parent
c194abeb65
commit
f3bd8eda5b
|
|
@ -452,8 +452,8 @@ class ObjectMiddleware extends SerializerMiddleware {
|
|||
|
||||
addReferenceable(item);
|
||||
} else if (typeof item === "string") {
|
||||
if (item !== "") {
|
||||
// empty strings are shorter when not emitting a reference (this saves 1 byte per empty string)
|
||||
if (item.length > 1) {
|
||||
// short strings are shorter when not emitting a reference (this saves 1 byte per empty string)
|
||||
addReferenceable(item);
|
||||
}
|
||||
|
||||
|
|
@ -637,7 +637,7 @@ class ObjectMiddleware extends SerializerMiddleware {
|
|||
}
|
||||
}
|
||||
} else if (typeof item === "string") {
|
||||
if (item !== "") {
|
||||
if (item.length > 1) {
|
||||
addReferenceable(item);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue