Skip to content

Commit 3a489b0

Browse files
committed
enable for default named exports
1 parent 50af69e commit 3a489b0

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

lib/plugin.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -336,24 +336,24 @@ function staticAnalyseIfIsland(ast) {
336336
}
337337

338338
// // TODO: Enable once named exports are also handled
339-
// if (childNode.type == 'FunctionDeclaration') {
340-
// if (isFunctionIsland(childNode)) {
341-
// isIsland = true
342-
// }
343-
// }
344-
345-
// if (childNode.type == 'VariableDeclaration') {
346-
// childNode.declarations.forEach(dec => {
347-
// if (
348-
// dec.init === 'ArrowFunctionExpression' ||
349-
// dec.init === 'FunctionExpression'
350-
// ) {
351-
// if (isFunctionIsland(dec.init)) {
352-
// isIsland = true
353-
// }
354-
// }
355-
// })
356-
// }
339+
if (childNode.type == 'FunctionDeclaration') {
340+
if (isFunctionIsland(childNode)) {
341+
isIsland = true
342+
}
343+
}
344+
345+
if (childNode.type == 'VariableDeclaration') {
346+
childNode.declarations.forEach(dec => {
347+
if (
348+
dec.init === 'ArrowFunctionExpression' ||
349+
dec.init === 'FunctionExpression'
350+
) {
351+
if (isFunctionIsland(dec.init)) {
352+
isIsland = true
353+
}
354+
}
355+
})
356+
}
357357
})
358358

359359
return isIsland

0 commit comments

Comments
 (0)