webpack / webpack-sources

Source code handling classes for webpack
MIT License
261 stars 71 forks source link

Sources whose source() return strings do not have the correct size() if it contains unicode #18

Closed mzgoddard closed 5 years ago

mzgoddard commented 7 years ago

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.

alexander-akait commented 6 years ago

@mzgoddard problem still exists? IF yes, can you provide minimum reproducible test repo?