]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
chore: catch unhandled export as just in case
authorEvan You <yyx990803@gmail.com>
Mon, 6 Feb 2023 01:02:41 +0000 (09:02 +0800)
committerEvan You <yyx990803@gmail.com>
Mon, 6 Feb 2023 01:02:41 +0000 (09:02 +0800)
rollup.dts.config.js

index 63906c10d17dd1396fc4afeb373b894073458e62..84a6138b44b6632fe13dda3b76907536455e07b0 100644 (file)
@@ -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