Closed acailly closed 7 years ago
Yes, it is, because published version is always compiled to ES5.
When you install it via npm i string-pixel-width --save
, it will work with ES5.
Actually only ES6 missing features of Node v6 are compiled because it uses es2015-node6/object-rest preset. This means this lib can't be used un the browser.
Ohh, sorry, didn't realize that. Which preset exactly would help you?
The preset es2015
should contains all es6 features
Version 1.2.0 is out. Should work for you now :)
It works! Thank you.
Today many build config does not support ES6 modules because it uses an old version of Uglify.
This is the case for
create-react-app
(see here)Until
uglify-es
use spreads (see here), would it be possible to distribute this lib as an ES5 module ?