Skip to content

Commit 6df8f87

Browse files
committed
fix(babel7): plugin options are centralized since Babel7-beta.3
refs: babel/babel#6376
1 parent d874b65 commit 6df8f87

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
var createEspowerPlugin = require('./create');
1414

15-
module.exports = function (babel) {
16-
return createEspowerPlugin(babel);
15+
module.exports = function (babel, options) {
16+
return createEspowerPlugin(babel, options);
1717
};

lib/create-espower-visitor.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ var BabelEspowerVisitor = require('./babel-espower-visitor');
77
module.exports = function createEspowerVisitor (babel, options) {
88
return {
99
visitor: {
10-
Program: function (path, state) {
10+
Program: function (path) {
1111
var opts = assign(defaultOptions(), {
1212
astWhiteList: babel.types.BUILDER_KEYS,
1313
visitorKeys: babel.types.VISITOR_KEYS,
1414
sourceRoot: process.cwd()
15-
}, options, state.opts);
15+
}, options);
1616
var espowerVisitor = new BabelEspowerVisitor(babel, opts);
1717
var innerVisitor = Object.keys(opts.visitorKeys).reduce(function (handlers, nodeType) {
1818
handlers[nodeType] = {
@@ -25,7 +25,7 @@ module.exports = function createEspowerVisitor (babel, options) {
2525
};
2626
return handlers;
2727
}, {});
28-
path.traverse(innerVisitor, state);
28+
path.traverse(innerVisitor);
2929
}
3030
}
3131
};

0 commit comments

Comments
 (0)