Skip to content
2 changes: 1 addition & 1 deletion __snapshots__/tsnapi/index.snapshot.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export interface ExportsOptions {
}
export interface InlineConfig extends UserConfig {
config?: boolean | string;
configLoader?: "auto" | "native" | "unrun";
configLoader?: "auto" | "native" | "tsx" | "unrun";
filter?: RegExp | Arrayable<string>;
}
export interface Logger {
Expand Down
6 changes: 1 addition & 5 deletions docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ bun add -D typescript
:::

:::tip Compatibility Note
`tsdown` requires Node.js version 20.19 or higher. Please ensure your development environment meets this requirement before installing. While `tsdown` is primarily tested with Node.js, support for Deno and Bun is experimental and may not work as expected.
:::

:::warning Node.js Deprecation
Node.js versions below 22.18.0 are deprecated and support will be removed in the next minor release. Please upgrade to Node.js 22.18.0 or later.
`tsdown` requires Node.js version 22.18.0 or higher. Please ensure your development environment meets this requirement before installing. While `tsdown` is primarily tested with Node.js, support for Deno and Bun is experimental and may not work as expected.
:::

### Starter Templates {#starter-templates}
Expand Down
7 changes: 4 additions & 3 deletions docs/options/config-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ This is useful if you want to rely solely on command-line options or default set
`tsdown` supports multiple config loaders to accommodate various file formats. You can select a config loader using the `--config-loader` option. The available loaders are:

- `auto` (default): Utilizes native runtime loading for TypeScript if supported; otherwise, defaults to `unrun`.
- `native`: Loads TypeScript configuration files using native runtime support. Requires a compatible environment, such as the latest Node.js, Deno, or Bun.
- `unrun`: Loads configuration files using the [`unrun`](https://gugustinette.github.io/unrun/) library. It provides more powerful and flexible loading capabilities.
- `native`: Loads TypeScript configuration files using native runtime support. Requires a compatible environment, such as Node.js 22.18.0+, Deno, or Bun.
- `tsx`: Loads configuration files using the [`tsx`](https://tsx.is/) library via its [tsImport API](https://tsx.is/dev-api/ts-import). Note that `tsx` is an optional peer dependency — you need to install it manually if you want to use this loader.
- `unrun`: Loads configuration files using the [`unrun`](https://gugustinette.github.io/unrun/) library. It provides more powerful and flexible loading capabilities. Note that `unrun` is an optional peer dependency — you need to install it manually if you want to use this loader.

> [!TIP]
> Node.js does not natively support importing TypeScript files without specifying the file extension. If you are using Node.js and want to load a TypeScript config file without including the `.ts` extension, consider using the `unrun` loader for seamless compatibility.
> Node.js does not natively support importing TypeScript files without specifying the file extension. If you are using Node.js and want to load a TypeScript config file without including the `.ts` extension, consider installing and using the `tsx` or `unrun` loader for seamless compatibility.

## Extending Vite or Vitest Config (Experimental)

Expand Down
6 changes: 1 addition & 5 deletions docs/zh-CN/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,7 @@ bun add -D typescript
:::

:::tip 兼容性说明
`tsdown` 需要 Node.js 20.19 或更高版本。请确保您的开发环境满足此要求后再进行安装。虽然 `tsdown` 主要在 Node.js 下测试,但对 Deno 和 Bun 的支持仍为实验性,可能无法正常工作。
:::

:::warning Node.js 弃用警告
低于 22.18.0 的 Node.js 版本已被弃用,将在下一个 minor 版本中移除支持。请升级到 Node.js 22.18.0 或更高版本。
`tsdown` 需要 Node.js 22.18.0 或更高版本。请确保您的开发环境满足此要求后再进行安装。虽然 `tsdown` 主要在 Node.js 下测试,但对 Deno 和 Bun 的支持仍为实验性,可能无法正常工作。
:::

### 起步模板 {#starter-templates}
Expand Down
7 changes: 4 additions & 3 deletions docs/zh-CN/options/config-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,12 @@ tsdown --no-config
`tsdown` 支持多种配置加载器,以适配不同的文件格式。您可以通过 `--config-loader` 选项选择配置加载器。可用的加载器包括:

- `auto`(默认):如果运行时支持,则使用原生方式加载 TypeScript,否则回退到 `unrun`。
- `native`:通过原生运行时支持加载 TypeScript 配置文件。需要兼容的环境,如最新版 Node.js、Deno 或 Bun。
- `unrun`:使用 [`unrun`](https://gugustinette.github.io/unrun/) 库加载配置文件,提供更强大和灵活的加载能力。
- `native`:通过原生运行时支持加载 TypeScript 配置文件。需要兼容的环境,如 Node.js 22.18.0+、Deno 或 Bun。
- `tsx`:使用 [`tsx`](https://tsx.is/) 库通过其 [tsImport API](https://tsx.is/dev-api/ts-import) 加载配置文件。注意 `tsx` 是可选的 peer dependency,需要手动安装后才能使用。
- `unrun`:使用 [`unrun`](https://gugustinette.github.io/unrun/) 库加载配置文件,提供更强大和灵活的加载能力。注意 `unrun` 是可选的 peer dependency,需要手动安装后才能使用。

> [!TIP]
> Node.js 原生需要指定文件扩展名才能导入 TypeScript 文件。如果您在 Node.js 环境下希望加载不带 `.ts` 扩展名的 TypeScript 配置文件,建议使用 `unrun` 加载器以获得更好的兼容性。
> Node.js 原生需要指定文件扩展名才能导入 TypeScript 文件。如果您在 Node.js 环境下希望加载不带 `.ts` 扩展名的 TypeScript 配置文件,建议安装并使用 `tsx` 或 `unrun` 加载器以获得更好的兼容性。

## 扩展 Vite 或 Vitest 配置(实验性功能){#extending-vite-or-vitest-config-experimental}

Expand Down
25 changes: 17 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "tsdown",
"type": "module",
"version": "0.21.10",
"packageManager": "pnpm@10.33.2",
"version": "0.22.0-beta.2",
"packageManager": "pnpm@11.0.0",
"description": "The Elegant Bundler for Libraries",
"author": "Kevin Deng <sxzz@sxzz.moe>",
"license": "MIT",
Expand Down Expand Up @@ -72,7 +72,7 @@
}
},
"engines": {
"node": ">=20.19.0"
"node": ">=22.18.0"
},
"scripts": {
"lint": "eslint --cache --max-warnings 0 .",
Expand All @@ -93,9 +93,11 @@
"@tsdown/css": "workspace:*",
"@tsdown/exe": "workspace:*",
"@vitejs/devtools": "*",
"publint": "^0.3.0",
"publint": "^0.3.8",
"tsx": "*",
"typescript": "^5.0.0 || ^6.0.0",
"unplugin-unused": "^0.5.0"
"unplugin-unused": "^0.5.0",
"unrun": "*"
},
"peerDependenciesMeta": {
"@arethetypeswrong/core": {
Expand All @@ -113,11 +115,17 @@
"publint": {
"optional": true
},
"tsx": {
"optional": true
},
"typescript": {
"optional": true
},
"unplugin-unused": {
"optional": true
},
"unrun": {
"optional": true
}
},
"dependencies": {
Expand All @@ -135,13 +143,12 @@
"tinyexec": "catalog:prod",
"tinyglobby": "catalog:prod",
"tree-kill": "catalog:prod",
"unconfig-core": "catalog:prod",
"unrun": "catalog:prod"
"unconfig-core": "catalog:prod"
},
"inlinedDependencies": {
"is-in-ci": "2.0.0",
"package-manager-detector": "1.6.0",
"pkg-types": "2.3.0"
"pkg-types": "2.3.1"
},
"devDependencies": {
"@arethetypeswrong/core": "catalog:peer",
Expand Down Expand Up @@ -174,12 +181,14 @@
"rolldown-plugin-require-cjs": "catalog:dev",
"sass": "catalog:dev",
"tsnapi": "catalog:dev",
"tsx": "catalog:dev",
"typescript": "catalog:dev",
"unocss": "catalog:docs",
"unplugin-ast": "catalog:dev",
"unplugin-raw": "catalog:dev",
"unplugin-unused": "catalog:peer",
"unplugin-vue": "catalog:dev",
"unrun": "catalog:dev",
"vite": "catalog:docs",
"vitest": "catalog:dev",
"vue": "catalog:docs"
Expand Down
4 changes: 2 additions & 2 deletions packages/create-tsdown/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "create-tsdown",
"type": "module",
"version": "0.21.10",
"version": "0.22.0-beta.2",
"description": "Create a new tsdown project",
"author": "Kevin Deng <sxzz@sxzz.moe>",
"license": "MIT",
Expand Down Expand Up @@ -53,7 +53,7 @@
}
},
"engines": {
"node": ">=20.19.0"
"node": ">=22.18.0"
},
"scripts": {
"dev": "node ./src/run.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/css/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tsdown/css",
"type": "module",
"version": "0.21.10",
"version": "0.22.0-beta.2",
"description": "Advanced CSS pipeline for tsdown powered by Lightning CSS",
"author": "Kevin Deng <sxzz@sxzz.moe>",
"license": "MIT",
Expand Down Expand Up @@ -42,7 +42,7 @@
}
},
"engines": {
"node": ">=20.19.0"
"node": ">=22.18.0"
},
"scripts": {
"build": "node -C dev ../../src/run.ts -c ../../tsdown.config.ts -F ."
Expand Down
4 changes: 2 additions & 2 deletions packages/exe/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tsdown/exe",
"type": "module",
"version": "0.21.10",
"version": "0.22.0-beta.2",
"description": "Cross-platform executable building for tsdown",
"author": "Kevin Deng <sxzz@sxzz.moe>",
"license": "MIT",
Expand Down Expand Up @@ -42,7 +42,7 @@
}
},
"engines": {
"node": ">=20.19.0"
"node": ">=22.18.0"
},
"scripts": {
"build": "node -C dev ../../src/run.ts -c ../../tsdown.config.ts -F ."
Expand Down
4 changes: 2 additions & 2 deletions packages/migrate/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tsdown-migrate",
"type": "module",
"version": "0.21.10",
"version": "0.22.0-beta.2",
"description": "A CLI tool to help migrate your project to tsdown.",
"author": "Kevin Deng <sxzz@sxzz.moe>",
"license": "MIT",
Expand Down Expand Up @@ -53,7 +53,7 @@
}
},
"engines": {
"node": ">=20.19.0"
"node": ">=22.18.0"
},
"scripts": {
"dev": "node ./src/run.ts",
Expand Down
Loading
Loading