Skip to content

Commit e42d5e7

Browse files
fix: use es2015 for legacy build (#36)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 23727dc commit e42d5e7

File tree

6 files changed

+35
-11
lines changed

6 files changed

+35
-11
lines changed

.changeset/selfish-days-love.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"exceptionally": patch
3+
---
4+
5+
use `es2015` as target fo legacy build

.size-limit.cjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ const config = [
77
},
88
{
99
path: 'lib/index.cjs',
10-
limit: '226 b',
10+
limit: '192 b',
1111
},
1212
{
1313
path: 'lib/index.global.js',
14-
limit: '208 b',
14+
limit: '176 b',
1515
},
1616
]
1717

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
- e97b58d: upgrade to TypeScript 5
88
- e97b58d: improve type definition for `processInParallel`
99

10+
## 2.8.1
11+
12+
### Patch Changes
13+
14+
- 1c5de55: use `es2015` as target fo legacy build
15+
1016
## 2.8.0
1117

1218
### Minor Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"---- DEV -----------------------------------------------------------------------------": "",
77
"dev": "tsup --watch",
88
"---- BUILD ---------------------------------------------------------------------------": "",
9-
"build": "tsup",
9+
"build": "tsup && tsup --config tsup-legacy.config.ts",
1010
"release": "pnpm build && npm publish",
1111
"---- TEST ----------------------------------------------------------------------------": "",
1212
"test": "pnpm tsc && pnpm vitest",

tsup-legacy.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from 'tsup'
2+
import { getTsupConfig } from './tsup.config.js'
3+
4+
export default defineConfig(({ watch }) => ({
5+
...getTsupConfig(watch),
6+
entry: ['src/legacy.ts'],
7+
target: 'es2015',
8+
}))

tsup.config.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1-
import { defineConfig } from 'tsup'
1+
import { defineConfig, type Options } from 'tsup'
2+
3+
export const getTsupConfig = (watch: Options['watch']) =>
4+
({
5+
outDir: 'lib',
6+
format: ['esm', 'cjs', 'iife'],
7+
dts: true,
8+
treeshake: true,
9+
sourcemap: !!watch,
10+
minify: !watch,
11+
}) satisfies Options
212

313
export default defineConfig(({ watch }) => ({
4-
entry: ['src/index.ts', 'src/assert/index.ts', 'src/utils/index.ts', 'src/legacy.ts'],
5-
outDir: 'lib',
6-
format: ['esm', 'cjs', 'iife'],
7-
dts: true,
8-
treeshake: true,
9-
sourcemap: !!watch,
14+
...getTsupConfig(watch),
1015
clean: true,
11-
minify: !watch,
16+
entry: ['src/index.ts', 'src/assert/index.ts', 'src/utils/index.ts'],
1217
}))

0 commit comments

Comments
 (0)