diff --git a/package.json b/package.json index e580cc7..093f801 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,6 @@ "license": "MIT", "dependencies": { "@babel/runtime": "^7.12.5", - "@babel/traverse": "^7.12.9", "cosmiconfig": "^7.0.0", "resolve": "^1.19.0" }, diff --git a/src/index.js b/src/index.js index e2128a9..a4073b5 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,5 @@ const p = require('path') const resolve = require('resolve') -const traverse = require('@babel/traverse').default // const printAST = require('ast-pretty-print') const macrosRegex = /[./]macro(\.c?js)?$/ @@ -232,7 +231,7 @@ function applyMacros({ * * See: https://github.com/kentcdodds/import-all.macro/issues/7 */ - traverse(state.file.ast, { + state.file.scope.path.traverse({ Identifier() {}, })