gulp-util 相关的问题
升级后的一些兼容处理
gulp v4.0.0-alpha.3 版本之后,有一些不兼容的更新,总共有 6,752 个模块依赖了 gulp-util 会受到影响。
可以通过下面的方式修复:
为什么废弃 gulp-util
巴拉巴拉巴拉
怎么修复这些问题
只能通知用了 gulp-util 包的作者升级组件啦。方法如下:
-
运行 npm ls gulp-util 获取依赖 gulp-util 的包列表。
-
对每个依赖 gulp-util 执行 npm issues {PLUGIN NAME},打开项目的 issue 管理页。
-
新建一个 issue 或者 pull request,移除 gulp-util,并用下面方法代替。
- gutil.File => https://www.npmjs.com/package/vinyl
- gutil.replaceExtension => The .extname property on Vinyl objects or https://www.npmjs.com/package/replace-ext
- gutil.colors => https://www.npmjs.com/package/ansi-colors
- gutil.date => https://www.npmjs.com/package/date-format
- gutil.log => https://www.npmjs.com/package/fancy-log
- gutil.template => https://www.npmjs.com/package/lodash.template
- gutil.env => https://www.npmjs.com/package/minimist
- gutil.beep => https://www.npmjs.com/package/beeper
- gutil.noop => https://www.npmjs.com/package/through2
- gutil.isStream => Use the .isStream() method on Vinyl objects
- gutil.isBuffer => Use the .isBuffer() method on Vinyl objects
- gutil.isNull => Use the .isNull() method on Vinyl objects
- gutil.linefeed => Use the string '\n' in your code
- gutil.combine => https://www.npmjs.com/package/multipipe
- gutil.buffer => https://www.npmjs.com/package/list-stream
- gutil.PluginError => https://www.npmjs.com/package/plugin-error