How to use uglifyjs with classes?

1

I have written a library called joe.js which contains some functions and two classes. The problem comes when I try to use the uglifyjs command

uglifyjs joe.pretty.js --compress --mangle > joe.js

which returns the error:

Parse error at joe.pretty.js:6,6
Unexpected token: name (Dice) 
Error
at new JS_Parse_Error (/usr/lib/node_modules/uglify-js@2/lib/parse.js:196:18                                                                                                                               )
at js_error (/usr/lib/node_modules/uglify-js@2/lib/parse.js:204:11)
at croak (/usr/lib/node_modules/uglify-js@2/lib/parse.js:663:9)
at token_error (/usr/lib/node_modules/uglify-js@2/lib/parse.js:671:9)
at unexpected (/usr/lib/node_modules/uglify-js@2/lib/parse.js:677:9)
at semicolon (/usr/lib/node_modules/uglify-js@2/lib/parse.js:697:43)
at simple_statement (/usr/lib/node_modules/uglify-js@2/lib/parse.js:871:73)
at /usr/lib/node_modules/uglify-js@2/lib/parse.js:744:19
at /usr/lib/node_modules/uglify-js@2/lib/parse.js:710:24
at /usr/lib/node_modules/uglify-js@2/lib/parse.js:1445:23

Which is because I have a class called dice which does not recognize. Any solution?

    
asked by Somelx 10.11.2017 в 13:27
source

0 answers