Skip to content

Commit

Permalink
Support projects built with Babel 7 (#13)
Browse files Browse the repository at this point in the history
* Support projects built with Babel 7

* Go into one more path object layer
  • Loading branch information
sltenorio99 authored and sorrycc committed May 21, 2019
1 parent fbcb09c commit 26a8af3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ export default function ({ types:t }) {
delete cache[filename];
},
},
CallExpression(path, { opts }) {
const { filename } = path.hub.file.opts;
CallExpression(path, state) {
const { opts } = state;
const {filename} = (path && path.hub && path.hub.file && path.hub.file.opts) || (state && state.file);
if (cache[filename]) return;
const { callee, arguments: args } = path.node;
if (isRouterCall(callee, path.scope)) {
Expand Down

0 comments on commit 26a8af3

Please sign in to comment.