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啥的...小白不是很懂,也没找到解决办法
希望大佬能指点一番。

阅读 3.7k
2 个回答

var babel = require('gulp-babel');
引入babel
再pipe(babel())使用

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进