Referencing TypeScript file includes whole file in output(引用 TypeScript 文件在输出中包含整个文件)
问题描述
我创建了一个安装了 TypeScript 0.8.1 和 Web Essentials 的新 Windows 8 JavaScript Blank 应用.
I have created a new Windows 8 JavaScript Blank app with TypeScript 0.8.1 and Web Essentials installed.
我已将文件 foo.ts 和 bar.ts 添加到我的项目中.
I have added both a file foo.ts and bar.ts to my project.
foo.ts 只包含一个简单的类:
foo.ts contains only a simple class:
class Foo
{ }
bar.ts 包含对 foo.ts 的引用和类 bar:
bar.ts contains a reference to foo.ts and a class bar:
/// <reference path="foo.ts" />
class Bar
{ }
奇怪的是 bar.js 同时包含 Bar 和 Foo 类:
The strange thing is that bar.js contains both the Bar and Foo class:
var Foo = (function () {
function Foo() { }
return Foo;
})();
var Bar = (function () {
function Bar() { }
return Bar;
})();
出了什么问题?我正在使用共享 reference.ts 文件处理一个更大的项目.突然间我所有的 ts 文件都编译成每个 javascript 文件了.
What is going wrong? I'm working on a larger project with a shared reference.ts file. Suddenly all my ts files are compiled to each javascript file.
推荐答案
我确实使用 -out 参数来控制编译器的文件放置.我刚刚发布了此位置的修复以进行测试:http://madskristensen.net/custom/webessentials2012.vsix
I do indeed use the -out parameter to control the compiler's file placements. I've just released the fix to this location for testing: http://madskristensen.net/custom/webessentials2012.vsix
请尝试一下并告诉我它是否有效.谢谢!
Please try it out and tell me if it worked. Thanks!
这篇关于引用 TypeScript 文件在输出中包含整个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:引用 TypeScript 文件在输出中包含整个文件
基础教程推荐
- 原生拖动事件后如何获取 mouseup 事件? 2022-01-01
- 如何添加到目前为止的天数? 2022-01-01
- 在 contenteditable 中精确拖放 2022-01-01
- Bokeh Div文本对齐 2022-01-01
- 检查 HTML5 拖放文件类型 2022-01-01
- Bootstrap 模态出现在背景下 2022-01-01
- npm start 错误与 create-react-app 2022-01-01
- fetch 是否支持原生多文件上传? 2022-01-01
- Fabric JS绘制具有活动形状的多边形 2022-01-01
- 即使用户允许,Gmail 也会隐藏外部电子邮件图片 2022-01-01
