From 2f4709c417c29bf1131b95d6e951ebe2d1ef6c41 Mon Sep 17 00:00:00 2001 From: 59naga Date: Tue, 3 Jul 2018 05:47:07 +0900 Subject: [PATCH] fix: closes #58 --- src/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.js b/src/index.js index d68e8d4..9739332 100644 --- a/src/index.js +++ b/src/index.js @@ -7,6 +7,11 @@ module.exports = ({template, types}) => { let pluginOptions const ExportsDefaultVisitor = { AssignmentExpression (path) { + // Not `object.anything`, skip + if (!path.get('left.object').node) { + return + } + const name = `${path.get('left.object.name').node}.${path.get(`left.property.name`).node}` if (name === 'exports.default') { const finder = new ExportsFinder(path)