ulid / javascript

Universally Unique Lexicographically Sortable Identifier

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

error when bundle for producation

ChiaJune opened this issue · comments

ulid version

v2.2.1

webpack version

v3.8.1

library or framework

React v15.6.1

error message

ERROR in static/js/vendor.d444dbbb14fee2232a46.js from UglifyJs
Unexpected token: name (done) [./node_modules/ulid/lib/index.js:20,0][static/js/vendor.d444dbbb14fee2232a46.js:92761,8]

This library is written in ES6. You need to add the module to your transpiler (babel) to compile it down to ES5 first.

@ChiaJune, I'm guessing that a transpiler solved your issues. Feel free re-open if you have any other questions.