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

Webpack using --uglify fails #13

Closed
Svettis2k opened this issue Nov 2, 2017 · 3 comments
Closed

Webpack using --uglify fails #13

Svettis2k opened this issue Nov 2, 2017 · 3 comments

Comments

@Svettis2k
Copy link

When attempting to use webpack with uglify the process fails giving this message:

ERROR in vendor.js from UglifyJs
Unexpected token: operator (>) [vendor.js:82349,55]

This refers to the following line:

return string.replace(new RegExp(( + find.map(i => i.replace(/[.?*+^$[\]\\(){}|-]/g, \\$&)).join(|) + ), “g”), match => replace[find.indexOf(match)]);

The problem is that the default UglifyJsPlugin of nativescript-dev-webpack does not support the => notation, as it does not support ES6. This issue explains the problem. I was able to solve it simply by replacing the => with function() {} in resource.common.js.

return string.replace(new RegExp(( + find.map(function (i) { return i.replace(/[.?*+^$[\]\\(){}|-]/g, \\$&) }).join(|) + ), “g”), function (match) { return replace[find.indexOf(match)] });
@lfabreges
Copy link
Collaborator

Should be fixed in 2.0.3

@lfabreges
Copy link
Collaborator

Actually it will probably not work, I'm on it right now

lfabreges added a commit that referenced this issue Nov 4, 2017
Moved demos
Added Travis CI
@lfabreges
Copy link
Collaborator

Should be ok now

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