delegate to babel-cli/babel-core if it's available #1244
This commit is contained in:
parent
b51411f090
commit
dd84b554e6
16
index.js
Normal file
16
index.js
Normal file
@ -0,0 +1,16 @@
|
||||
var path = require("path"
|
||||
);
|
||||
var isCli = module.parent.filename.indexOf(path.sep + "babel" + path.sep) >= 0;
|
||||
|
||||
if (!isCli && module.parent.filename !== __filename) {
|
||||
try {
|
||||
module.exports = require("babel/node_modules/babel-core");
|
||||
return;
|
||||
} catch (err) {
|
||||
if (err.code !== "MODULE_NOT_FOUND") {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = require("./lib/babel/api/node.js");
|
||||
@ -5,7 +5,6 @@
|
||||
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
||||
"homepage": "https://babeljs.io/",
|
||||
"repository": "babel/babel",
|
||||
"main": "lib/babel/api/node.js",
|
||||
"browser": {
|
||||
"./lib/babel/api/register/node.js": "./lib/babel/api/register/browser.js"
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user