Make babel-register 7.x backward-compatible with 6.x. (#6268)
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// required to safely use babel/register within a browserify codebase
|
||||
|
||||
export default function() {}
|
||||
export default function register() {}
|
||||
|
||||
export function revert() {}
|
||||
|
||||
15
packages/babel-register/src/index.js
Normal file
15
packages/babel-register/src/index.js
Normal 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);
|
||||
Reference in New Issue
Block a user