Strings returned by source() that have unicode characters outside of the ascii range have lengths that are not the number of bytes of the string but the number of unicode characters in the string. The number of bytes could be computer by casting the string to a Buffer whose length will be the number of bytes or other possible ways.
As it is, webpack features and plugins that depend on an accurate size value to produce some output or reflect some information are likely to not work as expected.
Strings returned by
source()
that have unicode characters outside of the ascii range have lengths that are not the number of bytes of the string but the number of unicode characters in the string. The number of bytes could be computer by casting the string to aBuffer
whose length will be the number of bytes or other possible ways.As it is, webpack features and plugins that depend on an accurate size value to produce some output or reflect some information are likely to not work as expected.