Skip to content

Commit e1a79b8

Browse files
committed
fix: disable conflicting code
enable this back when named exports are handled and each file can have more than one island
1 parent 67e2c7d commit e1a79b8

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

lib/plugin.js

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -335,24 +335,25 @@ function staticAnalyseIfIsland(ast) {
335335
// not handled right now
336336
}
337337

338-
if (childNode.type == 'FunctionDeclaration') {
339-
if (isFunctionIsland(childNode)) {
340-
isIsland = true
341-
}
342-
}
343-
344-
if (childNode.type == 'VariableDeclaration') {
345-
childNode.declarations.forEach(dec => {
346-
if (
347-
dec.init === 'ArrowFunctionExpression' ||
348-
dec.init === 'FunctionExpression'
349-
) {
350-
if (isFunctionIsland(dec.init)) {
351-
isIsland = true
352-
}
353-
}
354-
})
355-
}
338+
// // 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+
// }
356357
})
357358

358359
return isIsland

0 commit comments

Comments
 (0)