Skip to content

Commit

Permalink
fix(babel-plugin-export-metadata): remove cache folders from parse
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed Apr 11, 2019
1 parent 81c7915 commit 2978a26
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions other-packages/babel-plugin-export-metadata/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const addFileMetaProperties = (t, path, filename, name) => {

const insertNodeExport = t => (path, state) => {
const filename = getFilename(state)
if (/(\.cache|\.docz).+/.test(filename)) return

const name = get(path, 'node.declaration.id.name')
const declarations = get(path, 'node.declaration.declarations')
const specifiers = get(path, 'node.specifiers')
Expand All @@ -63,6 +65,8 @@ const insertNodeExport = t => (path, state) => {

const insertNodeExportDefault = t => (path, state) => {
const filename = getFilename(state)
if (/(\.cache|\.docz).+/.test(filename)) return

const declaration = get(path, 'node.declaration', {})

if (/Function|Class|Identifier/.test(declaration.type)) {
Expand Down

0 comments on commit 2978a26

Please sign in to comment.