antonmedv / jsize

Find out minified and gzipped npm package size
MIT License
178 stars 12 forks source link

"string" must be a string, Buffer, or ArrayBuffer #36

Closed antonmedv closed 7 years ago

antonmedv commented 7 years ago

Got a few bugs this this message. For example jsize @medv/list

   @medv/list  =  ⠧

[fsevents] Success: "/private/var/folders/jz/2vkj2mlx1kl_mkbp2y41sxcr0000gn
   @medv/list  =  X

"string" must be a string, Buffer, or ArrayBuffer
DylanPiercey commented 7 years ago

This bug happens since we are not transpiling es2016+, for example template strings, which are not compatible with uglify.

We have a few options:

1) Compile code with babel (perhaps use preset-env and allow user overrides). 2) Switch to babel-minify, uglify-es or butternut. 3) Both.

What are your thoughts @antonmedv?

antonmedv commented 7 years ago

Both will be cool. First try uglify-js, next babel-minify.

antonmedv commented 7 years ago
⌘ jsize ⎇ master $ jsize react+react-dom -v

   Package               Initial  Minified  Gzipped

   react + react-dom  =  687 kB   145 kB    43.6 kB

⌘ jsize ⎇ babel-minify $ jsize react+react-dom -v

   Package               Initial  Minified  Gzipped

   react + react-dom  =  687 kB   146 kB    44.2 kB
DylanPiercey commented 7 years ago

?

antonmedv commented 7 years ago

One kilobite extra with babel-minify

DylanPiercey commented 7 years ago

Yeah but not much we can do about that.

antonmedv commented 7 years ago

Okay