There was an error while loading. Please reload this page.
1 parent f7fb6bf commit 1a74e31Copy full SHA for 1a74e31
1 file changed
packages/directive-functions-plugin/src/compilers.ts
@@ -561,7 +561,7 @@ function codeFrameError(
561
}
562
563
const safeRemoveExports = (ast: babel.types.File) => {
564
- ast.program.body = ast.program.body.map((node) => {
+ ast.program.body = ast.program.body.flatMap((node) => {
565
if (
566
babel.types.isExportNamedDeclaration(node) ||
567
babel.types.isExportDefaultDeclaration(node)
@@ -581,6 +581,9 @@ const safeRemoveExports = (ast: babel.types.File) => {
581
582
583
return node.declaration
584
+ } else if (node.declaration === null) {
585
+ // remove e.g. `export { RouteComponent as component }`
586
+ return []
587
588
589
return node
0 commit comments