From 9542f73568381fe47e6c2402244e1a221f82e52a Mon Sep 17 00:00:00 2001 From: hyrious Date: Wed, 12 Jul 2023 11:53:17 +0800 Subject: [PATCH] fix: remove enum hack This was fixed in upstream: https://github.com/Swatinem/rollup-plugin-dts/pull/255 --- src/rollup.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/rollup.ts b/src/rollup.ts index fbc4d38e..fa9a2f50 100644 --- a/src/rollup.ts +++ b/src/rollup.ts @@ -132,15 +132,6 @@ const getRollupConfig = async ( }, } - const fixEnumDeclaration: Plugin = { - name: 'tsup:fix-enum-declaration', - renderChunk(code) { - // make sure enum declaration starts with `declare` - // #834 - return code.replace(/^(\s*)enum\s/gm, '$1declare enum ') - }, - } - return { inputConfig: { input: dtsOptions.entry, @@ -181,7 +172,6 @@ const getRollupConfig = async ( target: ts.ScriptTarget.ESNext, }, }), - fixEnumDeclaration, ].filter(Boolean), external: [ // Exclude dependencies, e.g. `lodash`, `lodash/get`