Setting the file. One moment.
Subchapter 8.17
references/option-exe.mdMarkdown3 KBView on GitHub
exe[experimental] Bundle as a standalone executable using Node.js Single Executable Applications.
export default defineConfig({
entry: ['src/cli.ts'],
exe: true,
})esm to cjs (unless Node.js >= 25.7.0)dts) is disabled by defaultexport default defineConfig({
entry: ['src/cli.ts'],
exe: {
fileName: 'my-tool',
seaConfig: {
disableExperimentalSEAWarning: true,
useCodeCache: true,
useSnapshot: false,
},
},
})| Option | Type | Description |
|---|---|---|
seaConfig | Omit<SeaConfig, 'main' | 'output' | 'mainFormat'> | Node.js configuration options |
fileName | string | ((chunk) => string) | Custom output file name (without .exe or platform suffixes) |
targets | ExeTarget[] | Cross-platform build targets (requires @tsdown/exe) |
| Option | Type | Default | Description |
|---|---|---|---|
disableExperimentalSEAWarning | boolean | true | Disable the experimental warning |
useSnapshot | boolean | false | Use V8 snapshot |
useCodeCache | boolean | false | Use V8 code cache |
execArgv | string[] | - | Extra Node.js arguments |
execArgvExtension | 'none' | 'env' | 'cli' | 'env' | How to extend execArgv |
assets | Record<string, string> | - | Assets to embed |
Install @tsdown/exe to build executables for multiple platforms from a single machine:
pnpm add -D @tsdown/exeexport default defineConfig({
entry: ['src/cli.ts'],
exe: {
targets: [
{ platform: 'linux', arch: 'x64', nodeVersion: '25.7.0' },
{ platform: 'darwin', arch: 'arm64', nodeVersion: '25.7.0' },
{ platform: 'win', arch: 'x64', nodeVersion: '25.7.0' },
],
},
})This downloads the target platform’s Node.js binary, caches it locally, and produces platform-suffixed output:
dist/
cli-linux-x64
cli-darwin-arm64
cli-win-x64.exe| Field | Type | Description |
|---|---|---|
platform | 'win' | 'darwin' | 'linux' | Target OS (nodejs.org naming) |
arch | 'x64' | 'arm64' | Target CPU architecture |
nodeVersion | string | Node.js version (must be >=25.7.0) |
Downloaded Node.js binaries are cached in system cache directories:
~/Library/Caches/tsdown/node/~/.cache/tsdown/node/%LOCALAPPDATA%/tsdown/Caches/node/.exe extension is automatically appendedtargets is specified, seaConfig.executable is ignoredtsdown --exe
tsdown src/cli.ts --exe