每日构建

TypeScript 的 main 分支的夜间构建在太平洋标准时间午夜发布到 npm。以下是你如何获取它并将其与你的工具一起使用。

¥A nightly build from the TypeScript’s main branch is published by midnight PST to npm. Here is how you can get it and use it with your tools.

使用 npm

¥Using npm

shell
npm install -D typescript@next

更新你的 IDE 以使用每日构建

¥Updating your IDE to use the nightly builds

你还可以更新编辑器/IDE 以使用 nightly drop。你通常需要通过 npm 安装该软件包。本节的其余部分主要假设 typescript@next 已安装。

¥You can also update your editor/IDE to use the nightly drop. You will typically need to install the package through npm. The rest of this section mostly assumes typescript@next is already installed.

Visual Studio Code

VS Code 网站 有关于选择 TypeScript 工作区版本的文档。在工作区中安装夜间版本的 TypeScript 后,你可以按照那里的说明进行操作,或者只需在 JSON 视图中更新工作区设置。执行此操作的直接方法是打开或创建工作区的 .vscode/settings.json 并添加以下属性:

¥The VS Code website has documentation on selecting a workspace version of TypeScript. After installing a nightly version of TypeScript in your workspace, you can follow directions there, or simply update your workspace settings in the JSON view. A direct way to do this is to open or create your workspace’s .vscode/settings.json and add the following property:

json
"typescript.tsdk": "<path to your folder>/node_modules/typescript/lib"

或者,如果你只想在 Visual Studio Code 中运行 JavaScript 和 TypeScript 的夜间编辑体验而不更改工作区版本,则可以运行 JavaScript 和 TypeScript 日常扩展

¥Alternatively, if you simply want to run the nightly editing experience for JavaScript and TypeScript in Visual Studio Code without changing your workspace version, you can run the JavaScript and TypeScript Nightly Extension

Sublime Text

使用以下内容更新 Settings - User 文件:

¥Update the Settings - User file with the following:

json
"typescript_tsdk": "<path to your folder>/node_modules/typescript/lib"

用于 Sublime Text 安装文档的 TypeScript 插件 上提供了更多信息。

¥More information is available at the TypeScript Plugin for Sublime Text installation documentation.

Visual Studio 2013 和 2015

¥Visual Studio 2013 and 2015

注意:大多数更改不需要你安装新版本的 VS TypeScript 插件。

¥Note: Most changes do not require you to install a new version of the VS TypeScript plugin.

日常构建目前不包括完整的插件设置,但我们也在努力发布每晚的安装程序。

¥The nightly build currently does not include the full plugin setup, but we are working on publishing an installer on a nightly basis as well.

  1. 下载 VSDevMode.ps1 脚本。

    ¥Download the VSDevMode.ps1 script.

    另请参阅我们关于 使用自定义语言服务文件 的 wiki 页面。

    ¥Also see our wiki page on using a custom language service file.

  2. 在 PowerShell 命令窗口中,运行:

    ¥From a PowerShell command window, run:

对于 VS 2015:

¥For VS 2015:

VSDevMode.ps1 14 -tsScript <path to your folder>/node_modules/typescript/lib

对于 VS 2013:

¥For VS 2013:

VSDevMode.ps1 12 -tsScript <path to your folder>/node_modules/typescript/lib

IntelliJ IDEA(Mac)

转到 Preferences > Languages & Frameworks > TypeScript

¥Go to Preferences > Languages & Frameworks > TypeScript:

TypeScript 版本:如果你使用 npm 安装:/usr/local/lib/node_modules/typescript/lib

¥TypeScript Version: If you installed with npm: /usr/local/lib/node_modules/typescript/lib

IntelliJ IDEA(Windows)

转到 File > Settings > Languages & Frameworks > TypeScript

¥Go to File > Settings > Languages & Frameworks > TypeScript:

TypeScript 版本:如果你使用 npm 安装:C:\Users\USERNAME\AppData\Roaming\npm\node_modules\typescript\lib

¥TypeScript Version: If you installed with npm: C:\Users\USERNAME\AppData\Roaming\npm\node_modules\typescript\lib