diff --git a/release/core/publish/steps/generate-tarballs.ts b/release/core/publish/steps/generate-tarballs.ts index f25ac0f2414..d1cf914a141 100644 --- a/release/core/publish/steps/generate-tarballs.ts +++ b/release/core/publish/steps/generate-tarballs.ts @@ -173,7 +173,9 @@ async function convertFileToModule(fileData: string, relativePath: string, pkgNa const moduleName = maybeModuleName.endsWith('/index') ? maybeModuleName.slice(0, -6) : maybeModuleName; for (let i = 0; i < lines.length; i++) { - const line = lines[i].replace(/^declare /, '').replaceAll(' declare ', ''); + lines[i] = lines[i].replace(/^declare /, '').replaceAll(' declare ', ' '); + const line = lines[i]; + if (line.startsWith('import ')) { if (!line.includes(`'`)) { throw new Error(`Unhandled import in ${relativePath}`);