Revert "make babel injectable in babel-register"

This commit is contained in:
Henry Zhu
2018-01-30 12:39:38 -05:00
committed by GitHub
parent 22c8f6376c
commit 82b6ee734b
3 changed files with 2 additions and 42 deletions

View File

@@ -2,7 +2,7 @@ import deepClone from "lodash/cloneDeep";
import sourceMapSupport from "source-map-support";
import * as registerCache from "./cache";
import escapeRegExp from "lodash/escapeRegExp";
import * as babelCore from "@babel/core";
import * as babel from "@babel/core";
import { OptionManager, DEFAULT_EXTENSIONS } from "@babel/core";
import { addHook } from "pirates";
import fs from "fs";
@@ -10,7 +10,6 @@ import path from "path";
const maps = {};
const transformOpts = {};
let babel = null;
let piratesRevert = null;
function installSourceMapSupport() {
@@ -101,9 +100,6 @@ register({
export default function register(opts?: Object = {}) {
// Clone to avoid mutating the arguments object with the 'delete's below.
opts = Object.assign({}, opts);
babel = opts.babel ? opts.babel : babelCore;
if (opts.extensions) hookExtensions(opts.extensions);
if (opts.cache === false && cache) {
@@ -114,7 +110,6 @@ export default function register(opts?: Object = {}) {
cache = registerCache.get();
}
delete opts.babel;
delete opts.extensions;
delete opts.cache;