Make babel-register 7.x backward-compatible with 6.x. (#6268)

This commit is contained in:
Logan Smyth
2017-09-19 09:52:57 -07:00
committed by GitHub
parent e98bb3dc60
commit bd734f03fb
3 changed files with 22 additions and 3 deletions

View File

@@ -5,8 +5,10 @@
"license": "MIT",
"repository": "https://github.com/babel/babel/tree/master/packages/babel-register",
"author": "Sebastian McKenzie <sebmck@gmail.com>",
"main": "lib/node.js",
"browser": "lib/browser.js",
"main": "lib/index.js",
"browser": {
"./lib/node.js": "./lib/browser.js"
},
"dependencies": {
"babel-core": "7.0.0-beta.0",
"core-js": "^2.4.0",

View File

@@ -1,3 +1,5 @@
// required to safely use babel/register within a browserify codebase
export default function() {}
export default function register() {}
export function revert() {}

View File

@@ -0,0 +1,15 @@
/**
* This file wraps the compiled ES6 module implementation of register so
* that it can be used both from a standard CommonJS environment, and also
* from a compiled Babel import.
*/
exports = module.exports = function(...args) {
return register(...args);
};
exports.__esModule = true;
const node = require("./node");
const register = node.default;
Object.assign(exports, node);