如何设置VS 2013 TypeScript项目以编译我的打字稿文件,但排除我的node_modules? [英] How can I setup my VS 2013 TypeScript project to compile my typescript files but exclude my node_modules?

查看:127
本文介绍了如何设置VS 2013 TypeScript项目以编译我的打字稿文件,但排除我的node_modules?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IntelliJ中熟悉了它之后,我正在VS 2013中进行angular2 @ beta项目.可以将IntelliJ设置为查找tsconfig.json文件,并且从TypeScript 1.6开始,它可以读取"exclude"属性,而不尝试编译任何node_modules.现在,我使用TypeScript 1.7迁移到VS 2013,现在我遇到了尝试编译node_modules的问题.我已经包含了tsconfig.json,但是据我所读,仅在VS 2015中完全支持tsconfig.json.这是此问题上的最新消息吗?有什么办法告诉VS 2013排除那些文件或改用我的tsconfig.json吗?

I'm working on an angular2@beta project in VS 2013 after familiarizing myself with it in IntelliJ. IntelliJ can be set to find the tsconfig.json file and, as of TypeScript 1.6, it can therefore read the "exclude" property and not attempt to compile any of the node_modules. Now that I've moved to VS 2013 with TypeScript 1.7, I'm running into the issue where it's trying to compile the node_modules. I've included the tsconfig.json, but from what I've read, tsconfig.json is fully supported only in VS 2015. Is that the latest on this issue? Is there some way to tell VS 2013 to exclude those files or to use my tsconfig.json instead?

我还应该注意,当我执行npm安装时,angular2 @ beta会在其其余源代码中包含其类型.这会将所有类型的输入与所有文件混合在一起,并且我想也许我可能必须删除所有non.d.ts文件才能获得没有其他所有错误的类型.以前,您可以使用"tsd install angular2"来进行输入,但此功能不再可用.解决方案可以消除以前的问题.

I should also note that angular2@beta includes its typings with the rest of its source when I do an npm install. This puts all the typings mixed in with all the files, and I assume perhaps I could have to delete all the non-.d.ts files to get the typings without all the other errors. Previously you could use "tsd install angular2" to get the typings but this is no longer available. A solution to this would negate the previous problem.

更新

我可以在 VS 2015-社区版 >,但我真的很想看看我是否可以在VS 2013上使用它.

I can get all this working on VS 2015 - Community Edition, but I would really like to see if I can get it working on VS 2013.

推荐答案

Visual Studio 2013不支持更高版本的Typescript.但是,您无需在同一IDE中编辑和编译Typescript文件.这很方便,但是只要对齐构建过程,我经常在同一项目中使用不同的IDE(请参阅:可以通过CLI完成).因此,您可以将Visual Studio Code用于您的Typescript工作并进行编译.全面支持tsconfig文件并提供Intellisense.

Higher versions of Typescript will not be supported in Visual Studio 2013. But you don't need to edit and compile typescript files in one and the same IDE. It's handy but I use often different IDE's for the same project as long as the build processes are aligned (read: can be done by CLI). So yo can use Visual Studio Code for your Typescript work and compile it. Full support and Intellisense for the tsconfig file.

https://code.visualstudio.com/

这篇关于如何设置VS 2013 TypeScript项目以编译我的打字稿文件,但排除我的node_modules?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆