Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: egoist/tsup
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.6.0
Choose a base ref
...
head repository: egoist/tsup
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.6.1
Choose a head ref
  • 2 commits
  • 1 file changed
  • 1 contributor

Commits on Feb 12, 2023

  1. Copy the full SHA
    a85439d View commit details
  2. chore: update lockfile

    egoist committed Feb 12, 2023
    1
    Copy the full SHA
    70a586c View commit details
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/rollup.ts
10 changes: 10 additions & 0 deletions src/rollup.ts
Original file line number Diff line number Diff line change
@@ -131,6 +131,15 @@ 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,
@@ -171,6 +180,7 @@ const getRollupConfig = async (
target: ts.ScriptTarget.ESNext,
},
}),
fixEnumDeclaration,
].filter(Boolean),
external: [
// Exclude dependencies, e.g. `lodash`, `lodash/get`