hexo博客gulp压缩出现问题
hexo博客代码压缩按照网上教程做的,结果出现下面的情况:
$ gulp build
[20:29:16] Using gulpfile D:\Blog\gulpfile.js
[20:29:16] Starting 'minify-html'...
[20:29:16] Starting 'minify-css'...
[20:29:16] Starting 'minify-js'...
[20:29:16] Starting 'images'...
[20:29:16] Finished 'images' after 1.29 ms
[20:29:16] gulp-imagemin: Minified 0 images
events.js:160
throw er; // Unhandled 'error' event
^
GulpUglifyError: unable to minify JavaScript
at createError (D:\Blog\node_modules\gulp-uglify\lib \create-error.js:6:14)
at apply (D:\Blog\node_modules\lodash\_apply.js:16:2 5)
at wrapper (D:\Blog\node_modules\lodash\_createCurry .js:41:12)
at D:\Blog\node_modules\gulp-uglify\lib\minify.js:54 :15
at DestroyableTransform._transform (D:\Blog\node_mod ules\gulp-uglify\composer.js:10:23)
at DestroyableTransform.Transform._read (D:\Blog\nod e_modules\through2\node_modules\readable-stream\lib\_str eam_transform.js:182:10)
at DestroyableTransform.Transform._write (D:\Blog\no de_modules\through2\node_modules\readable-stream\lib\_st ream_transform.js:170:83)
at doWrite (D:\Blog\node_modules\through2\node_modul es\readable-stream\lib\_stream_writable.js:406:64)
at writeOrBuffer (D:\Blog\node_modules\through2\node _modules\readable-stream\lib\_stream_writable.js:395:5)
at DestroyableTransform.Writable.write (D:\Blog\node _modules\through2\node_modules\readable-stream\lib\_stre am_writable.js:322:11)
Google了半天,说是es6啥的...小白不是很懂,也没找到解决办法
希望大佬能指点一番。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
var babel = require('gulp-babel');
引入babel
再pipe(babel())使用
gulp.task img 引入路径不正确