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

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

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);

View file

@ -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 }

View file

@ -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 {};