gulp-terser icon indicating copy to clipboard operation
gulp-terser copied to clipboard

SyntaxError: Unexpected token: keyword (function)

Open phonowell opened this issue 4 years ago • 3 comments

gulp.src(source, { base, sourcemaps })
        .pipe(tsProject())
        .pipe(gulpIf(!!minify, terser({ safari10: true })))
        .pipe(gulp.dest(target, this.returnSourcemaps(sourcemaps)))
        .on('end', () => resolve(true))

With [email protected] & [email protected], got this error message. Need help.

phonowell avatar Dec 24 '20 05:12 phonowell

You can try to configure the ecma of terser.

duan602728596 avatar Dec 24 '20 06:12 duan602728596

Doesn't seem to work, still throwing errors. Whether ecma is 5, 2015 or 2016.

phonowell avatar Dec 25 '20 02:12 phonowell

Can you post the code? It seems that the version of ecma is still too low.

duan602728596 avatar Dec 25 '20 04:12 duan602728596