Allow regular plugins/presets resolution algorithm for packages outside of the monorepo (#7582)

This commit is contained in:
Mateusz Burzyński 2018-09-08 01:37:10 +02:00 committed by Logan Smyth
parent 1b03906da4
commit 1e1a89ca70

View File

@ -118,8 +118,11 @@ function wrapPackagesArray(type, names, optionsDir) {
val[0] = path.resolve(optionsDir, val[0]);
} else {
// check node_modules/babel-x-y
val[0] = __dirname + "/../../babel-" + type + "-" + val[0];
const monorepoPath = __dirname + "/../../babel-" + type + "-" + val[0];
if (fs.existsSync(monorepoPath)) {
val[0] = monorepoPath;
}
}
return val;