Make babel-register 7.x backward-compatible with 6.x. (#6268)
This commit is contained in:
@@ -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