Skip to content

Commit e12ab7f

Browse files
authored
feat(dts): upgrade rolldown-plugin-dts to v0.29, upgrade deps (#1121)
1 parent 4435a48 commit e12ab7f

8 files changed

Lines changed: 1719 additions & 1598 deletions

File tree

‎docs/recipes/vue-support.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default defineConfig({
2222
entry: ['./src/index.ts'],
2323
platform: 'neutral',
2424
plugins: [Vue({ isProduction: true })],
25-
dts: { vue: true },
25+
dts: { tsc: { vue: true } },
2626
})
2727
```
2828

@@ -51,7 +51,7 @@ bun add -D unplugin-vue vue-tsc
5151
## How It Works
5252

5353
- **`unplugin-vue`** compiles `.vue` single-file components into JavaScript and extracts CSS, making them ready for bundling.
54-
- **`rolldown-plugin-dts`** (with `vue: true`) and **`vue-tsc`** work together to generate accurate TypeScript declaration files for your Vue components, ensuring consumers of your library get full type support.
54+
- **`rolldown-plugin-dts`** (with `tsc.vue: true`) and **`vue-tsc`** work together to generate accurate TypeScript declaration files for your Vue components, ensuring consumers of your library get full type support.
5555

5656
> [!TIP]
5757
> Set `platform: 'neutral'` to maximize compatibility for libraries that may be used in both browser and Node.js environments.

‎docs/zh-CN/recipes/vue-support.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default defineConfig({
2222
entry: ['./src/index.ts'],
2323
platform: 'neutral',
2424
plugins: [Vue({ isProduction: true })],
25-
dts: { vue: true },
25+
dts: { tsc: { vue: true } },
2626
})
2727
```
2828

@@ -51,7 +51,7 @@ bun add -D unplugin-vue vue-tsc
5151
## 工作原理
5252

5353
- **`unplugin-vue`** 会将 `.vue` 单文件组件编译为 JavaScript 并提取 CSS,使其可以直接打包。
54-
- **`rolldown-plugin-dts`**(配合 `vue: true`)和 **`vue-tsc`** 协同工作,为您的 Vue 组件生成准确的 TypeScript 声明文件,确保库的使用者获得完整的类型支持。
54+
- **`rolldown-plugin-dts`**(配合 `tsc.vue: true`)和 **`vue-tsc`** 协同工作,为您的 Vue 组件生成准确的 TypeScript 声明文件,确保库的使用者获得完整的类型支持。
5555

5656
> [!TIP]
5757
> 建议将 `platform` 设置为 `'neutral'`,以最大化兼容性,方便您的库同时用于浏览器和 Node.js 环境。

0 commit comments

Comments
 (0)