Skip to content

Commit

Permalink
refactor: simplify output extension logic
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Nov 21, 2024
1 parent 4827a81 commit 0375da5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/features/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ export function resolveOutputExtension(
): 'mjs' | 'cjs' | 'js' {
const moduleType = getPackageType(pkg)
switch (format) {
case 'iife':
case 'umd':
return 'js'
case 'es':
case 'esm':
case 'module': {
Expand All @@ -19,5 +16,7 @@ export function resolveOutputExtension(
case 'commonjs': {
return moduleType === 'module' ? 'cjs' : 'js'
}
default:
return 'js'
}
}

0 comments on commit 0375da5

Please sign in to comment.