Skip to content

Compile-on-save with typescriptservices.js from LKG drops module prefixes #2061

Description

@NoelAbrahams

Hi,

I'm using VS 2015 CTP 5 and wanted to try out typescriptservices.js from LKG of 12-Feb-2015.

Code like the following:

// my.d.ts
declare module foo.bar {
  class Baz { }
}

When referenced from another project

/// <reference path='my.d.ts' />
module foo.bar {
      var baz = <any>Baz.prototype;
}

is compiling into

var foo;
(function (foo) {
    var bar;
    (function (bar) {
        var baz = /*bar.*/Baz.prototype; // missing prefix
    })(bar = foo.bar || (foo.bar = {}));
})(foo || (foo  = {}));

This is only a problem when compile is triggered via save - generates the correct JavaScript when building.

Edit

This is a little bit more involved: The combine JS into output file also needs to be set. The faulty JS is generated not when the code file itself is saved, but when a sibling file in the same project is saved (which would cause the combined file to be generated).

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions