4

I have created a new Windows 8 JavaScript Blank app with TypeScript 0.8.1 and Web Essentials installed.

I have added both a file foo.ts and bar.ts to my project.

foo.ts contains only a simple class:

class Foo
{ }

bar.ts contains a reference to foo.ts and a class bar:

/// <reference path="foo.ts" />

class Bar
{ }

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;
})();

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.

2 Answers 2

6

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!

Sign up to request clarification or add additional context in comments.

5 Comments

So can you confirm. Did you also get the same problem and did the fix that you released makes it work okay?
Much better, at least for me
BTW: Since you are apparently looking at the code, is there a workaround that does NOT require an update to WebEssentials (such that we can use the current released version)
@AcidPAT version 1.8.5 is the current released version, and it works.
3

Normally this would only happen if you supplied an --out flag to the compiler:

tsc --out bar.js foo.ts bar.ts

Does this happen on save, or on build? If it happens on save, it is something to do with Web Essentials whereas if it happens on build you should check the source of your project file to see if has an --out flag.

4 Comments

It happens on save. I've run the typescript compiler from the command prompt without the -out part and then everything works fine. But when I hit save in Visual Studio, I get this strange behavior. I filed a bug with Web Essentials.
I can confirm that v1.8.5 of Web Essentials works for me now!
Strangely enough, I have this problem since 1.8.5
visualstudiogallery.msdn.microsoft.com/… as of now, 1.8.5 is the latest version. Where are you getting 1.8.8.3?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.