babel / minify

:scissors: An ES6+ aware minifier based on the Babel toolchain (beta)
https://babeljs.io/repl
MIT License
4.39k stars 225 forks source link

Feature request: Convert long repeated strings to `.repeat()` when minifying #1015

Open SiddharthShyniben opened 3 years ago

SiddharthShyniben commented 3 years ago

Is your feature request related to a problem? Please describe. Whenever I minify long strings using this minifier, The strings are left untouched. It would be nice if the long strings (Example '░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░') could be changed to '░'.repeat(35), which saves 21 characters

Describe the solution you'd like Replace long enough strings with .repeat() when minifying

Describe alternatives you've considered We could do this in the source code itself, but that defeats the purpose of a minifer

Additional context NA