-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce Node.js 6+ compatibility mode for gulp@3
- Loading branch information
Showing
4 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
|
||
// Initialize vinyl-fs-wrap in Node.js 6+ compatibility mode | ||
var vfsWrap = require('./vinyl-fs-wrap'); | ||
vfsWrap.initCompat(); | ||
|
||
// Export the origial Gulp | ||
module.exports = require('./index'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
'use strict'; | ||
|
||
var compat = false; | ||
|
||
function init() { | ||
if (exports.vfs) { | ||
return; | ||
} | ||
exports.vfs = require('vinyl-fs'); | ||
} | ||
|
||
function initCompat() { | ||
if (exports.vfs) { | ||
if (!compat) { | ||
throw new Error( | ||
'Gulp was already initialized in Node.js 6+ compatibility mode!\n' + | ||
'Make sure that you require gulp/compat before other gulp plugins.\n' + | ||
'If you do not, this error should not happen.\n' + | ||
'\n' + | ||
'Note that dependencies should not force this mode.\n' + | ||
'The compatibility mode is intended only for the top-most gulpfile.js.\n' | ||
); | ||
} | ||
return; | ||
} | ||
compat = true; | ||
exports.vfs = require('vinyl-fs-03-compat'); | ||
} | ||
|
||
exports.init = init; | ||
exports.initCompat = initCompat; |