From: Evan You Date: Mon, 6 Feb 2023 01:02:41 +0000 (+0800) Subject: chore: catch unhandled export as just in case X-Git-Tag: v3.3.0-alpha.3~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72b570917e1e6c9ca1073e26a8519bf43e05468b;p=thirdparty%2Fvuejs%2Fcore.git chore: catch unhandled export as just in case --- diff --git a/rollup.dts.config.js b/rollup.dts.config.js index 63906c10d1..84a6138b44 100644 --- a/rollup.dts.config.js +++ b/rollup.dts.config.js @@ -143,6 +143,17 @@ function patchTypes(pkg) { spec.type === 'ExportSpecifier' && shouldRemoveExport.has(spec.local.name) ) { + // @ts-ignore + const exported = spec.exported.name + if (exported !== spec.local.name) { + // this only happens if we have something like + // type Foo + // export { Foo as Bar } + // there are no such cases atm, so it is unhandled for now. + throw new Error( + `removed export ${exported} has different local name: ${spec.local.name}` + ) + } const next = node.specifiers[i + 1] if (next) { // @ts-ignore