Use the standard option parser to load the internal plugins.
This commit is contained in:
parent
38720ae309
commit
05ee30c9f7
@ -16,16 +16,17 @@ import path from "path";
|
||||
import * as t from "babel-types";
|
||||
|
||||
import resolve from "../../helpers/resolve";
|
||||
import OptionManager from "./options/option-manager";
|
||||
|
||||
import blockHoistPlugin from "../internal-plugins/block-hoist";
|
||||
import shadowFunctionsPlugin from "../internal-plugins/shadow-functions";
|
||||
|
||||
const shebangRegex = /^#!.*/;
|
||||
|
||||
const INTERNAL_PLUGINS = [
|
||||
[blockHoistPlugin],
|
||||
[shadowFunctionsPlugin],
|
||||
];
|
||||
const INTERNAL_PLUGINS = new OptionManager().init({
|
||||
babelrc: false,
|
||||
plugins: [ blockHoistPlugin, shadowFunctionsPlugin ],
|
||||
}).plugins;
|
||||
|
||||
const errorVisitor = {
|
||||
enter(path, state) {
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import Plugin from "../plugin";
|
||||
import sortBy from "lodash/sortBy";
|
||||
|
||||
export default new Plugin({
|
||||
export default {
|
||||
/**
|
||||
* [Please add a description.]
|
||||
*
|
||||
@ -39,4 +38,4 @@ export default new Plugin({
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import Plugin from "../plugin";
|
||||
import * as t from "babel-types";
|
||||
|
||||
const SUPER_THIS_BOUND = Symbol("super this bound");
|
||||
@ -15,7 +14,7 @@ const superVisitor = {
|
||||
},
|
||||
};
|
||||
|
||||
export default new Plugin({
|
||||
export default {
|
||||
name: "internal.shadowFunctions",
|
||||
|
||||
visitor: {
|
||||
@ -29,7 +28,7 @@ export default new Plugin({
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
function shouldShadow(path, shadowPath) {
|
||||
if (path.is("_forceShadow")) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user