Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions docs/.vitepress/config/theme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { existsSync } from 'node:fs'
import module from 'node:module'
import path from 'node:path'
import pkg from '../../../package.json' with { type: 'json' }
import { createTranslate } from '../i18n/utils.ts'
import type { DefaultTheme, HeadConfig, LocaleConfig } from 'vitepress'

Expand Down Expand Up @@ -73,6 +74,31 @@ export function getLocaleConfig(lang: string) {
link: `${urlPrefix}/reference/api/Interface.UserConfig.md`,
},
{ text: t('FAQ'), link: `${urlPrefix}/guide/faq.md` },
{
text: `v${pkg.version}`,
items: [
{
items: [
{
text: `v${pkg.version}`,
link: `https://github.com/rolldown/tsdown/releases/tag/v${pkg.version}`,
},
{
text: t('Release Notes'),
link: 'https://github.com/rolldown/tsdown/releases',
},
],
},
{
items: [
{
text: t('unreleased'),
link: 'https://main.tsdown.dev',
},
],
},
],
},
]

const sidebar: DefaultTheme.SidebarItem[] = [
Expand Down
2 changes: 2 additions & 0 deletions docs/.vitepress/i18n/translate-map.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const zhCN = {
// nav
Home: '首页',
'Release Notes': '发布说明',
unreleased: '未发布版本',
Guide: '指南',
'API Reference': 'API 参考',

Expand Down
12 changes: 6 additions & 6 deletions docs/guide/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ When you publish a library, your consumers install its `dependencies` and `peerD

**Key options:**

| Option | What it does |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`deps.onlyAllowBundle`](../options/dependencies.md#deps-onlyallowbundle) | Whitelist of dependencies allowed to be bundled. Any unlisted dependency that ends up in the bundle causes an error. Useful for catching accidental inlining in large projects. |
| [`deps.neverBundle`](../options/dependencies.md#deps-neverbundle) | Explicitly mark additional packages as external (never bundled). |
| [`deps.alwaysBundle`](../options/dependencies.md#deps-alwaysbundle) | Force specific packages to be bundled, even if they're in `dependencies`. |
| [`deps.skipNodeModulesBundle`](../options/dependencies.md#deps-skipnodemodulebundle) | Skip resolving and bundling everything from `node_modules`. |
| Option | What it does |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`deps.onlyAllowBundle`](../options/dependencies.md#deps-onlyallowbundle) | Whitelist of dependencies allowed to be bundled. Any unlisted dependency that ends up in the bundle causes an error. Useful for catching accidental inlining in large projects. |
| [`deps.neverBundle`](../options/dependencies.md#deps-neverbundle) | Explicitly mark additional packages as external (never bundled). |
| [`deps.alwaysBundle`](../options/dependencies.md#deps-alwaysbundle) | Force specific packages to be bundled, even if they're in `dependencies`. |
| [`deps.skipNodeModulesBundle`](../options/dependencies.md#deps-skipnodemodulebundle) | Skip resolving and bundling everything from `node_modules`. |

See [Dependencies](../options/dependencies.md) for details.

Expand Down
10 changes: 5 additions & 5 deletions docs/options/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ export default defineConfig({

The following top-level options are deprecated. Please migrate to the `deps` namespace:

| Deprecated Option | New Option |
|---|---|
| `external` | `deps.neverBundle` |
| `noExternal` | `deps.alwaysBundle` |
| `inlineOnly` | `deps.onlyAllowBundle` |
| Deprecated Option | New Option |
| ----------------------- | ---------------------------- |
| `external` | `deps.neverBundle` |
| `noExternal` | `deps.alwaysBundle` |
| `inlineOnly` | `deps.onlyAllowBundle` |
| `skipNodeModulesBundle` | `deps.skipNodeModulesBundle` |

## Summary
Expand Down
12 changes: 6 additions & 6 deletions docs/zh-CN/guide/how-it-works.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ tsdown 读取你的 `package.json` 和 `tsconfig.json` 来推断合理的默认

**主要选项:**

| 选项 | 说明 |
| ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| [`deps.onlyAllowBundle`](../options/dependencies.md#deps-onlyallowbundle) | 允许打包的依赖白名单。任何不在列表中的依赖如果出现在 bundle 中将触发错误。适用于防止大型项目中的意外内联。 |
| [`deps.neverBundle`](../options/dependencies.md#deps-neverbundle) | 显式将额外的包标记为外部依赖(不打包)。 |
| [`deps.alwaysBundle`](../options/dependencies.md#deps-alwaysbundle) | 强制打包特定的包,即使它们在 `dependencies` 中。 |
| [`deps.skipNodeModulesBundle`](../options/dependencies.md#deps-skipnodemodulebundle) | 跳过解析和打包所有来自 `node_modules` 的内容。 |
| 选项 | 说明 |
| ------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------- |
| [`deps.onlyAllowBundle`](../options/dependencies.md#deps-onlyallowbundle) | 允许打包的依赖白名单。任何不在列表中的依赖如果出现在 bundle 中将触发错误。适用于防止大型项目中的意外内联。 |
| [`deps.neverBundle`](../options/dependencies.md#deps-neverbundle) | 显式将额外的包标记为外部依赖(不打包)。 |
| [`deps.alwaysBundle`](../options/dependencies.md#deps-alwaysbundle) | 强制打包特定的包,即使它们在 `dependencies` 中。 |
| [`deps.skipNodeModulesBundle`](../options/dependencies.md#deps-skipnodemodulebundle) | 跳过解析和打包所有来自 `node_modules` 的内容。 |

详见[依赖](../options/dependencies.md)。

Expand Down
10 changes: 5 additions & 5 deletions docs/zh-CN/options/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,11 @@ export default defineConfig({

以下顶层选项已被废弃,请迁移到 `deps` 命名空间:

| 废弃选项 | 新选项 |
|---|---|
| `external` | `deps.neverBundle` |
| `noExternal` | `deps.alwaysBundle` |
| `inlineOnly` | `deps.onlyAllowBundle` |
| 废弃选项 | 新选项 |
| ----------------------- | ---------------------------- |
| `external` | `deps.neverBundle` |
| `noExternal` | `deps.alwaysBundle` |
| `inlineOnly` | `deps.onlyAllowBundle` |
| `skipNodeModulesBundle` | `deps.skipNodeModulesBundle` |

## 总结
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"test": "vitest",
"typecheck": "tsgo --noEmit",
"format": "prettier --cache --write .",
"release": "bumpp -r",
"release": "node ./scripts/release.ts",
"docs:dev": "pnpm -C docs run dev",
"docs:build": "pnpm -C docs run build",
"docs:preview": "pnpm -C docs run preview",
Expand Down
Loading
Loading