hack: use chokidar@2 only on node < 8 (#11560)
This commit is contained in:
@@ -33,7 +33,8 @@
|
||||
"source-map": "^0.5.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"chokidar": "^2.1.8"
|
||||
"chokidar": "^3.4.0",
|
||||
"chokidarAt2": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "^7.0.0-0"
|
||||
|
||||
@@ -116,7 +116,10 @@ process.on("uncaughtException", function (err) {
|
||||
|
||||
export function requireChokidar(): Object {
|
||||
try {
|
||||
return require("chokidar");
|
||||
// todo(babel 8): revert `chokidarAt2` hack
|
||||
return parseInt(process.version) >= 8
|
||||
? require("chokidar")
|
||||
: require("chokidarAt2");
|
||||
} catch (err) {
|
||||
console.error(
|
||||
"The optional dependency chokidar failed to install and is required for " +
|
||||
|
||||
Reference in New Issue
Block a user