File tree Expand file tree Collapse file tree 8 files changed +10
-26
lines changed
Expand file tree Collapse file tree 8 files changed +10
-26
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ tsdown can bundle your TypeScript/JavaScript code into a standalone executable u
88
99## Requirements
1010
11- - Node.js >= 25.5.0 (ESM support requires >= 25. 7.0)
11+ - Node.js >= 25.7.0
1212- Not supported in Bun or Deno
1313
1414## Basic Usage
@@ -28,7 +28,6 @@ export default defineConfig({
2828
2929When ` exe ` is enabled:
3030
31- - The default output format changes from ` esm ` to ` cjs ` (unless Node.js >= 25.7.0, which supports ESM)
3231- Declaration file generation (` dts ` ) is disabled by default
3332- Code splitting is disabled
3433- Only single entry points are supported
Original file line number Diff line number Diff line change @@ -250,11 +250,10 @@ An alias for `--copy`.
250250
251251** [ experimental] ** Bundle as a standalone executable using [ Node.js Single Executable Applications] ( https://nodejs.org/api/single-executable-applications.html ) .
252252
253- This will bundle the output into a single executable file. Requires Node.js 25.5 .0 or later, and is not supported in Bun or Deno. Cross-platform builds are supported via the ` @tsdown/exe ` package.
253+ This will bundle the output into a single executable file. Requires Node.js 25.7 .0 or later, and is not supported in Bun or Deno. Cross-platform builds are supported via the ` @tsdown/exe ` package.
254254
255255When ` exe ` is enabled:
256256
257- - The default output format changes from ` esm ` to ` cjs ` (unless Node.js >= v25.7.0, which supports ESM).
258257- Declaration file generation (` dts ` ) is disabled by default.
259258- Code splitting is disabled.
260259- Only single entry points are supported.
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ tsdown 可以使用 [Node.js 单可执行应用](https://nodejs.org/api/single-e
88
99## 环境要求
1010
11- - Node.js >= 25.5.0(ESM 支持需要 >= 25. 7.0)
11+ - Node.js >= 25.7.0
1212- 不支持 Bun 和 Deno
1313
1414## 基本用法
@@ -28,7 +28,6 @@ export default defineConfig({
2828
2929启用 ` exe ` 时:
3030
31- - 默认输出格式从 ` esm ` 变更为 ` cjs ` (Node.js >= 25.7.0 支持 ESM 时除外)
3231- 默认禁用声明文件生成(` dts ` )
3332- 禁用代码分割
3433- 仅支持单入口
Original file line number Diff line number Diff line change @@ -250,11 +250,10 @@ tsdown --copy public
250250
251251** [ 实验性] ** 使用 [ Node.js 单个可执行程序] ( https://nodejs.org/api/single-executable-applications.html ) 将输出打包为独立可执行文件。
252252
253- 此选项会将输出打包为单个可执行文件。需要 Node.js 25.5 .0 或更高版本,不支持 Bun 和 Deno 环境。通过 ` @tsdown/exe ` 包支持跨平台构建。
253+ 此选项会将输出打包为单个可执行文件。需要 Node.js 25.7 .0 或更高版本,不支持 Bun 和 Deno 环境。通过 ` @tsdown/exe ` 包支持跨平台构建。
254254
255255启用 ` exe ` 时:
256256
257- - 默认输出格式从 ` esm ` 变更为 ` cjs ` (Node.js >= v25.7.0 支持 ESM 时除外)。
258257- 默认禁用声明文件生成(` dts ` )。
259258- 禁用代码分割。
260259- 仅支持单入口。
Original file line number Diff line number Diff line change 11import semver from 'semver'
22import satisfies from 'semver/functions/satisfies.js'
33
4- const SEA_VERSION_RANGE = '>=25.7.0'
5-
64export type ExePlatform = 'win' | 'darwin' | 'linux'
75export type ExeArch = 'x64' | 'arm64'
86
@@ -64,10 +62,10 @@ export function normalizeNodeVersion(target: ExeTarget): string {
6462 )
6563 }
6664
67- if ( ! satisfies ( version , SEA_VERSION_RANGE ) ) {
65+ if ( ! satisfies ( version , '>=25.7.0' ) ) {
6866 throw new Error (
6967 `Node.js ${ version } does not support SEA (Single Executable Applications). ` +
70- `Required: ${ SEA_VERSION_RANGE } ` ,
68+ `Required minimum version is 25.7.0. Please update the nodeVersion in your target configuration. ` ,
7169 )
7270 }
7371
Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ import { blue } from 'ansis'
55import { createDefu } from 'defu'
66import isInCi from 'is-in-ci'
77import { createDebug } from 'obug'
8- import satisfies from 'semver/functions/satisfies.js'
98import { resolveClean } from '../features/clean.ts'
109import { resolveCssOptions } from '../features/css/index.ts'
1110import { resolveDepsConfig } from '../features/deps.ts'
@@ -293,18 +292,14 @@ export async function resolveUserConfig(
293292 write,
294293 }
295294
296- let defaultFormat : Format = 'esm'
297295 if ( exe ) {
298296 validateSea ( config )
299- if ( satisfies ( process . version , '<25.7.0' ) ) {
300- defaultFormat = 'cjs'
301- }
302297 }
303298
304299 const objectFormat = typeof format === 'object' && ! Array . isArray ( format )
305300 const formats = objectFormat
306301 ? ( Object . keys ( format ) as Format [ ] )
307- : resolveComma ( toArray < Format > ( format , defaultFormat ) )
302+ : resolveComma ( toArray < Format > ( format , 'esm' ) )
308303
309304 return formats . map ( ( fmt , idx ) : ResolvedConfig => {
310305 const once = idx === 0
Original file line number Diff line number Diff line change @@ -350,11 +350,6 @@ export interface UserConfig {
350350 * - `umd`: UMD
351351 *
352352 * Defaults to ESM.
353- *
354- * ### Usage with {@link exe}
355- * If `exe` is enabled, the default format will depend on support level of SEA in the target Node.js version:
356- * - If ESM SEA is supported (Node.js > v25.7), the default format will be ESM.
357- * - If only CJS SEA is supported, the default format will be CJS.
358353 */
359354 format ?: Format | Format [ ] | Partial < Record < Format , Partial < ResolvedConfig > > >
360355 globalName ?: string
@@ -593,7 +588,7 @@ export interface UserConfig {
593588 * **[experimental]** Bundle as executable using Node.js SEA (Single Executable Applications).
594589 *
595590 * This will bundle the output into a single executable file using Node.js SEA.
596- * Note that this is only supported on Node.js 25.5 .0 and later, and is not supported in Bun or Deno.
591+ * Note that this is only supported on Node.js 25.7 .0 and later, and is not supported in Bun or Deno.
597592 */
598593 exe ?: WithEnabled < ExeOptions >
599594
Original file line number Diff line number Diff line change @@ -59,9 +59,9 @@ export function validateSea({
5959 )
6060 }
6161
62- if ( ! satisfies ( process . version , '>=25.5 .0' ) ) {
62+ if ( ! satisfies ( process . version , '>=25.7 .0' ) ) {
6363 throw new Error (
64- `Node.js version ${ process . version } does not support \`exe\` option. Please upgrade to Node.js 25.5 .0 or later.` ,
64+ `Node.js version ${ process . version } does not support \`exe\` option. Please upgrade to Node.js 25.7 .0 or later.` ,
6565 )
6666 }
6767
You can’t perform that action at this time.
0 commit comments