Skip to content

Commit 4c745c1

Browse files
committed
handle exportNamedDeclarations which export default in matchExported
1 parent 7f33d91 commit 4c745c1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

matchExported.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// @flow
2-
const { explodeModule } = require("babel-explode-module");
3-
const { explodedToStatements } = require("babel-helper-simplify-module");
2+
const { explodeModule } = require('babel-explode-module');
3+
const { explodedToStatements } = require('babel-helper-simplify-module');
44
const printAST = require('ast-pretty-print');
5-
const t = require("babel-types");
5+
const t = require('babel-types');
66

77
module.exports = function matchExported(
88
file /* : Object */,
@@ -31,7 +31,11 @@ module.exports = function matchExported(
3131
return null;
3232
}
3333

34-
let statement = file.path.get("body").find(item => {
34+
if (local === 'default' && match.source) {
35+
local = exportName;
36+
}
37+
38+
let statement = file.path.get('body').find(item => {
3539
if (!item.isDeclaration()) return false;
3640

3741
let id = null;

0 commit comments

Comments
 (0)