Unable to use a Template String
Closed this issue · 1 comments
So, I've created a new JS file and inserted the below:
var a = 1;
var b = 2;
console.log(${a} ${b}
);
When I run Gulp the below error is returned:
events.js:141
throw er; // Unhandled 'error' event
^
GulpUglifyError: unable to minify JavaScript
at createError (C:\KCom\KCom.KC\node_modules\gulp-uglify\lib\create-error.js:6:14)
at apply (C:\KCom\KCom.KC\node_modules\gulp-uglify\node_modules\lodash_apply.js:16:25)
at wrapper (C:\KCom\KCom.KC\node_modules\gulp-uglify\node_modules\lodash_createCurry.js:41:12)
at C:\KCom\KCom.KC\node_modules\gulp-uglify\lib\minify.js:54:15
at DestroyableTransform._transform (C:\KCom\KCom.KC\node_modules\gulp-uglify\composer.js:10:23)
at DestroyableTransform.Transform._read (C:\KCom\KCom.KC\node_modules\through2\node_modules\readable-stream\lib_stream_transform.js:182:10)
at DestroyableTransform.Transform._write (C:\KCom\KCom.KC\node_modules\through2\node_modules\readable-stream\lib_stream_transform.js:170:83)
at doWrite (C:\KCom\KCom.KC\node_modules\through2\node_modules\readable-stream\lib_stream_writable.js:406:64)
at writeOrBuffer (C:\KCom\KCom.KC\node_modules\through2\node_modules\readable-stream\lib_stream_writable.js:395:5)
at DestroyableTransform.Writable.write (C:\KCom\KCom.KC\node_modules\through2\node_modules\readable-stream\lib_stream_writable.js:322:11)
Process terminated with code 1.
If I dont use the gulp-uglify package the gulp task runs fine and no error is returned.
"gulp": "^3.9.1",
"gulp-uglify": "^3.0.0"
Any thoughts?
You need to use a version of UglifyJS that supports harmony features. There's an example in the README