来自 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
shellnpm install -D typescript@next
更新你的 IDE 以使用每日构建
🌐 Updating your IDE to use the nightly builds
你也可以更新你的编辑器/IDE 来使用每夜版。你通常需要通过 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 版本的文档。
在工作区中安装 nightly 版本的 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 文本
🌐 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 插件版本。
日常构建目前不包括完整的插件设置,但我们也在努力发布每晚的安装程序。
🌐 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.
-
下载 VSDevMode.ps1 脚本。
另请参阅我们关于使用自定义语言服务文件的维基页面。
-
在 PowerShell 命令窗口中,运行:
对于 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)
🌐 IntelliJ IDEA (Mac)
转到 Preferences > Languages & Frameworks > TypeScript:
🌐 Go to Preferences > Languages & Frameworks > TypeScript:
TypeScript 版本:如果你是用 npm 安装的:
/usr/local/lib/node_modules/typescript/lib
IntelliJ IDEA(Windows)
🌐 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