8

I am getting

from UglifyJs SyntaxError: Unexpected token: punc (.)

error when running npm run build on angular2-webpack

This is coming from a spread operator.

Trying to demo a project in less than 1 hour.... FML

1 Answers1

-1

Changing the target from ES6 to ES5 can help. However, I was able to find a more reliable solution to use the advantages of ES6.

Simply specify UglifyJs in your package.json, and let npm handles the dependencies. "uglify-js": "git://github.com/mishoo/UglifyJS2#harmony-v2.8.22",

Burak Tasci
  • 887
  • 12
  • 18