fix(isolated-declarations): missing empty export when has an export declare (#5925)

This commit is contained in:
Dunqing committed 2024-09-20 14:19:02 +00:00
1 parent b80a9eec7f
commit 756a571432
3 files changed
+7 -1

No files matched your search

+1 -1
View File
@@ -253,7 +253,7 @@ impl<'a> IsolatedDeclarations<'a> {
transformed_spans.insert(decl.span);
if let Some(new_decl) = self.transform_export_named_declaration(decl) {
*decl = self.ast.alloc(new_decl);
} else {
} else if decl.declaration.is_none() {
need_empty_export_marker = false;
}
self.scope.visit_export_named_declaration(decl);
@@ -2,3 +2,7 @@ type A = string;
export function a(): A {
return ""
}
export declare const ShallowReactiveMarker: unique symbol
export type ShallowReactive<T> = T & { [ShallowReactiveMarker]?: true }
@@ -6,4 +6,6 @@ input_file: crates/oxc_isolated_declarations/tests/fixtures/empty-export.ts
type A = string;
export declare function a(): A;
export declare const ShallowReactiveMarker: unique symbol;
export type ShallowReactive<T> = T & { [ShallowReactiveMarker]?: true };
export {};