From 138a82410391d48794e821d542e30c8958cbd783 Mon Sep 17 00:00:00 2001 From: Myles Borins Date: Thu, 18 Aug 2016 17:39:47 +0300 Subject: [PATCH] Fallback to graceful-fs@4 if graceful-fs@3 is unsupported This uses a vinyl-fs@0.3 version coupled with graceful-fs@4 as a fallback for the regular combination of vinyl-fs@0.3 and graceful-fs@3, so that gulp@3 doesn't break on newer Node.js versions where graceful-fs@3 is unsupported. Current setups and Node.js versions (6.x and below) are not affected. --- index.js | 8 +++++++- package.json | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 42bc69b3d..1b2f43f10 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,13 @@ var util = require('util'); var Orchestrator = require('orchestrator'); var gutil = require('gulp-util'); var deprecated = require('deprecated'); -var vfs = require('vinyl-fs'); + +var vfs; +try { + vfs = require('vinyl-fs'); +} catch (e) { + vfs = require('vinyl-fs-03-compat'); +} function Gulp() { Orchestrator.call(this); diff --git a/package.json b/package.json index b60ba7d52..ff1e35796 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,8 @@ "semver": "^4.1.0", "tildify": "^1.0.0", "v8flags": "^2.0.2", - "vinyl-fs": "^0.3.0" + "vinyl-fs": "^0.3.0", + "vinyl-fs-03-compat": "^0.3.15" }, "devDependencies": { "coveralls": "^2.7.0",