diff --git a/packages/dev/buildTools/src/generateDeclaration.ts b/packages/dev/buildTools/src/generateDeclaration.ts index 897d194775d..5dbcdadba78 100644 --- a/packages/dev/buildTools/src/generateDeclaration.ts +++ b/packages/dev/buildTools/src/generateDeclaration.ts @@ -168,7 +168,8 @@ function getModuleDeclaration( return; } }); - processedLines = processedLines.replace(/export declare /g, "export "); + processedLines = processedLines.replace(/export declare /g, "export ").replace(/export const enum/g, "export enum"); + return `declare module "${moduleName}" { ${processedLines} } @@ -399,6 +400,8 @@ function getPackageDeclaration( } ); + processedSource = processedSource.replace(/export const enum/g, "export enum"); + processedSource = processedSource.replace( / global {([^}]*)}/gm, `