Skip to content

Commit 72b5709

Browse files
committed
chore: catch unhandled export as just in case
1 parent 37ec04b commit 72b5709

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

rollup.dts.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,17 @@ function patchTypes(pkg) {
143143
spec.type === 'ExportSpecifier' &&
144144
shouldRemoveExport.has(spec.local.name)
145145
) {
146+
// @ts-ignore
147+
const exported = spec.exported.name
148+
if (exported !== spec.local.name) {
149+
// this only happens if we have something like
150+
// type Foo
151+
// export { Foo as Bar }
152+
// there are no such cases atm, so it is unhandled for now.
153+
throw new Error(
154+
`removed export ${exported} has different local name: ${spec.local.name}`
155+
)
156+
}
146157
const next = node.specifiers[i + 1]
147158
if (next) {
148159
// @ts-ignore

0 commit comments

Comments
 (0)