模块解决方案:TypeScript 文档可能陈旧
Module Resolution: Possible staleness of TypeScript documentation
我刚刚在 TypeScript 文档中阅读了 this piece 关于模块解析的内容。
根据 the documentation of tsconfig.json
中的“@types、typeRoots 和类型”部分,我认为这不可能是全部内容,类型定义文件也来自 node_modules/@types目录。
该功能也已公布 here and is explained somewhat here。
我在 SO 上写这个问题是为了让人们确认我有那个权利,并为 TypeScript 人员提供文档错误报告(GitHub 上的票证提交指南吓跑了我)。
所以,我认为链接的文档不完整是正确的吗?
我认为你是对的。为了更加确定(为此或一般而言)我通常会看一下 the history of the module resolution docs themselves. They've had quite a few small updates recently, but otherwise the last major commit there was adding the changes in behaviour from TypeScript 1.8, back in March, well before these 2.0 changes. There is a bit more info on these changes under "Declaration Files" > "Consumption" (https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html),但它主要关注最终用户案例,而不是记录 tsc 稍后如何找到这些类型定义。
如果我是你,我会在 TypeScript-Handbook 存储库上打开一个错误并启动更新程序。老实说,所有这一切对我来说表明,现在没有太多时间研究这一点文档——准备好最有效的更新方法可能是自己整理一个大纲,并且然后请求帮助检查并填写详细信息。
我刚刚在 TypeScript 文档中阅读了 this piece 关于模块解析的内容。
根据 the documentation of tsconfig.json
中的“@types、typeRoots 和类型”部分,我认为这不可能是全部内容,类型定义文件也来自 node_modules/@types目录。
该功能也已公布 here and is explained somewhat here。
我在 SO 上写这个问题是为了让人们确认我有那个权利,并为 TypeScript 人员提供文档错误报告(GitHub 上的票证提交指南吓跑了我)。
所以,我认为链接的文档不完整是正确的吗?
我认为你是对的。为了更加确定(为此或一般而言)我通常会看一下 the history of the module resolution docs themselves. They've had quite a few small updates recently, but otherwise the last major commit there was adding the changes in behaviour from TypeScript 1.8, back in March, well before these 2.0 changes. There is a bit more info on these changes under "Declaration Files" > "Consumption" (https://www.typescriptlang.org/docs/handbook/declaration-files/consumption.html),但它主要关注最终用户案例,而不是记录 tsc 稍后如何找到这些类型定义。
如果我是你,我会在 TypeScript-Handbook 存储库上打开一个错误并启动更新程序。老实说,所有这一切对我来说表明,现在没有太多时间研究这一点文档——准备好最有效的更新方法可能是自己整理一个大纲,并且然后请求帮助检查并填写详细信息。