chronogolf / nativescript-store-update

Apache License 2.0
19 stars 13 forks source link

Cannot build project with --env.uglify if this plugin is included #24

Closed Burgov closed 6 years ago

Burgov commented 6 years ago

When I try to build the project with this plugin included, I get the following error:

ERROR in bundle.js from UglifyJs
Unexpected token name «s», expected punc «;» [bundle.js:88919,13]

I traced it back to the following piece of code:

global.__assign =
    (this && this.__assign) ||
    Object.assign ||
    function(t) {
    for (let s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i]
        for (const p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]
    }
    return t
    }

(it complains about the line starting with for (let s). Any ideas?

SBats commented 6 years ago

Hi,

I think it might be linked to the version of UglifyJS you use (v2 vs v3). Could you give a look at the following comment and follow its recommendation, then tell us if it's better? https://github.com/NativeScript/nativescript-angular/issues/1011#issuecomment-333539020

Burgov commented 6 years ago

yep, thanks!