tv4 icon indicating copy to clipboard operation
tv4 copied to clipboard

Minified version and method names

Open geraintluff opened this issue 10 years ago • 1 comments

The minifier doesn't shrink property/method names, even if those names are never accessible to the outside world.

From a rough inspection, if we replaced the validate*, createError and prefixWith methods along with the scanned* properties with single-character substitutions, we'd shave 5% (~1.4kb) off the minified version.

Is there a way to do this without screwing up the source-map, and would it be worth the hassle or not?

geraintluff avatar Jul 14 '14 11:07 geraintluff

We use grunt-contrib-uglify so I'm pretty sure a lot can be done. If not then any other grunt plugin will do (so many choices).

I don't think the alternative can read source-map's and mangle them together wile minifying like uglify does. But then, not sure if that is really needed; I guess debugging works better with the non-minified version.

Bartvds avatar Jul 14 '14 12:07 Bartvds