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

@@ -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);