Visual Studio 2015 - tsconfig.json - TypeScript 1.6.0 Beta [英] Visual Studio 2015 - tsconfig.json - TypeScript 1.6.0 Beta

查看:32
本文介绍了Visual Studio 2015 - tsconfig.json - TypeScript 1.6.0 Beta的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 File > 创建了一个空白的 HTML 应用程序和 TypeScript新 >VS2015 中的项目.

I created a blank HTML application with TypeScript using File > New > Project in VS2015.

我在 /scripts 文件夹中添加了一个基本的 tsconfig.json,并希望 VS 读取文件并将 .js 文件输出到不同的文件夹中.不幸的是,什么也没有发生.尽管 VS 甚至没有找到 tsconfig.json

I added a basic tsconfig.json in a /scripts folder and was expecting to have VS read the file and output the .js files into a different folder. Unfortunately, nothing happens. It's a though VS is not even finding the tsconfig.json

其他人有这个问题吗?

我知道 1.5 之前存在一个问题,但之前的修复似乎不起作用:https://github.com/Microsoft/TypeScript/issues/4300

I am aware there was a previous problem with 1.5, but the previous fix doesn't seem to work: https://github.com/Microsoft/TypeScript/issues/4300

---------------- 2015 年 9 月 10 日更新

---------------- Update 9/10/2015

这是一个示例 tsconfig.json

Here's one sample tsconfig.json

{
  "compilerOptions": {
    "noImplicitAny": false,
    "noEmitOnError": true,
    "removeComments": false,
    "sourceMap": true,
    "target": "es5",
    "module": "amd",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "outDir": "../www/scripts/"
  },
  "files": [
    "./scripts/index.ts"
  ]
}

这是另一个 tsconfig.json

Here's another tsconfig.json

{
"compilerOptions": {
    "target": "es5",
    "out": "/wwwroot/scripts/appBundle.js",
    "sourceMap": true,
    "removeComments": true,
    "sourceRoot": "/"
    }
}

我已经为 TypeScript + Cordova 项目创建了 tsconfig.json 文件并且它们工作正常.

I have created tsconfig.json files for TypeScript + Cordova projects and they work correctly.

推荐答案

在 typescript 1.8 Beta 之前,.tsconfig 在 .net 4.x 项目中被忽略.现在随着这个版本的发布,visual studio 会识别是否有 .tsconfig 文件并禁用其他项目类型.

Prior to typescript 1.8 Beta, .tsconfig was ignored for .net 4.x projects. Now with this released, visual studio does recognize if there is a .tsconfig file and disables the other project types.

只需确保您已卸载 Visual Studio 的 Typescript 以前版本,并安装最新版本.

Just make sure you have uninstalled previous versions of Typescript for Visual Studio, and install the latest version.

这是 VS 的 Typescript 1.8 Beta 安装文件:http://download.microsoft.com/download/6/D/8/6D8381B0-03C1-4BD2-AE65-30FF0A4C62DA/TS1.8.1-Beta-TS-master.20160126.1/TypeScript_Dev14Full.exe

Here is the install file for Typescript 1.8 Beta for VS: http://download.microsoft.com/download/6/D/8/6D8381B0-03C1-4BD2-AE65-30FF0A4C62DA/TS1.8.1-Beta-TS-master.20160126.1/TypeScript_Dev14Full.exe

这是他们的公告:https://blogs.msdn.microsoft.com/typescript/2016/01/28/annoucing-typescript-1-8-beta/

这篇关于Visual Studio 2015 - tsconfig.json - TypeScript 1.6.0 Beta的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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