Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uglify fails on 2.0 with RCA #33

Closed
Psykar opened this issue Jun 23, 2017 · 2 comments
Closed

Uglify fails on 2.0 with RCA #33

Psykar opened this issue Jun 23, 2017 · 2 comments

Comments

@Psykar
Copy link

Psykar commented Jun 23, 2017

See https://github.com/Psykar/test-icepick-uglify

RCA transpiles to ES5 before it attempts to uglify, but seems it's falling over on some ES6 syntax. Installing icepick@<2 does work, and I don't have the time to debug this further right now unfortunately, but the repro is pretty simple.

  • create-react-app test-icepick-uglify
  • cd test-icepick-uglify
  • yarn add icepick
  • Edit src/App.js to add an icepick import
  • yarn build
yarn build v0.24.6
$ react-scripts build 
Creating an optimized production build...
Failed to compile.

static/js/main.fd1459b7.js from UglifyJs
Unexpected token: operator (>) [./~/icepick/icepick.js:16,0][static/js/main.fd1459b7.js:11521,25]

error Command failed with exit code 1.

Alternatively, clone https://github.com/Psykar/test-icepick-uglify then yarn build and you'll also see it :)

@aearly
Copy link
Owner

aearly commented Jun 23, 2017

Looks like CRA doesn't use a version of uglify that supports ES6 yet: facebook/create-react-app#2108

In the meantime, you can use icepick@^1, there are no new features in 2.0,

@Psykar
Copy link
Author

Psykar commented Jun 23, 2017

So they're uglifying before transpiling. Weird. I guess this can be closed then, not an issue on your end (and yeah ^1 works fine =)

@Psykar Psykar closed this as completed Jun 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants