Skip to content
New issue

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

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

Already on GitHub? # to your account

UglifyJS issue #21

Closed
yanickrochon opened this issue Mar 22, 2017 · 7 comments
Closed

UglifyJS issue #21

yanickrochon opened this issue Mar 22, 2017 · 7 comments

Comments

@yanickrochon
Copy link

While building a meteor app, I got this error

UglifyJS minification error:

SyntaxError: Unexpected token: name (isLastCharLower) at
node_modules/camelcase/index.js line 4

It seems odd to me that this line would throw an error, but here we are.

@yanickrochon
Copy link
Author

Since the module uses ES2015 arrow functions, it is not compatible with client side code. I believe Meteor.js is working to enable Babel for node modules, but we are not there yet.

Note that arrow functions are still slower than legacy functions... I don't know why everyone use it everywhere already.

@Qix-
Copy link
Contributor

Qix- commented Mar 22, 2017

I'll let @sindresorhus respond to this (:

@mozillo
Copy link

mozillo commented Mar 23, 2017

Got same error

@sindresorhus
Copy link
Owner

Note that arrow functions are still slower than legacy functions...

No: https://kpdecker.github.io/six-speed/

@sindresorhus
Copy link
Owner

See: sindresorhus/ama#446

@yanickrochon
Copy link
Author

@sindresorhus what do you mean "no"? The link you suggest shows that declarations are generally 1.4x slower! Thus, in the actual implementation, you are effectively declaring arrow functions 3 times. Therefore, my statement is completely valid.

But this is beside the main issue; this module cannot be used on client side as it does not provide a browser friendly source, and UglifyJS fails.

You closed this issue without addressing the real problem.

@sindresorhus
Copy link
Owner

The arrow test shows it's identical. Even if it's 1.2x, that's pretty negligible in practice.

You closed this issue without addressing the real problem.

I linked to sindresorhus/ama#446. I don't have the time to answer this every time it comes up.

Repository owner locked and limited conversation to collaborators Mar 23, 2017
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants