Issue 1:
TypeScript Version:

1.8.7

Issue

I am developing with Rails and I want to use Typescript to compile to Javascript. In IntelliJ IDEA I have enabled the compilation of Typescript to Javascript.

The files are properly compiled with both SourceName.ts, SourceName.js and SourceName.js.map files generated. However, when I access the .ts file in Chrome debugger, the source code I see is the compiled Javascript, not typescript.

I've tried putting them in separate folders and it still doesn't work. Only thing that works is building inline sourcemaps in the compiler, but that produces weirdly named files in the root structure of the project.

EDIT: SourceMaps are properly compiled, the .ts file shows in the Chrome file tree, but has the same content as the .js file

EDIT 2: I've tried compiling using the npm package typescript. I created a test file called Testing.ts and used it to demonstrate the problem:

class Testing{
public static MakeWarn(){
console.log("abc");
}
}

I ran tsc Testing.ts --sourceMap which generated two files

Testing.js

Testing.js.map

The contents are as follows:

Testing.js

var Testing = (function () {
function Testing() {
}
Testing.MakeWarn = function () {
console.log("abc");
};
return Testing;
}());
//# sourceMappingURL=Testing.js.map

Testing.js.map

{"version":3,"file":"Testing.js","sourceRoot":"","sources":["Testing.ts"],"names":[],"mappings":"AAAA;IAAA;IAIA,CAAC;IAHiB,gBAAQ,GAAtB;QACI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IACL,cAAC;AAAD,CAAC,AAJD,IAIC"}

To my knowledge, these are properly defined .js and .js.map files.

When I open the link in Chrome, I get Testing.self.js and Testing.ts files which both have contents

var Testing = (function () {
function Testing() {
}
Testing.MakeWarn = function () {
console.log("abc");
};
return Testing;
}());
//# sourceMappingURL=Testing.js.map

This is not the expected behaviour. To my understanding, .ts file should look like the original source in Chrome debugger. And I should be able to put a breakpoint.

Expected behavior:

Should have different files for .ts and .js

Actual behavior:

In Chrome and Firefox Developer Edition has the same files for .ts and .js

Issue 2:
TypeScript Version:

1.8.7

Issue

I am developing with Rails and I want to use Typescript to compile to Javascript. In IntelliJ IDEA I have enabled the compilation of Typescript to Javascript.

The files are properly compiled with both SourceName.ts, SourceName.js and SourceName.js.map files generated. However, when I access the .ts file in Chrome debugger, the source code I see is the compiled Javascript, not typescript.

I've tried putting them in separate folders and it still doesn't work. Only thing that works is building inline sourcemaps in the compiler, but that produces weirdly named files in the root structure of the project.

SourceMaps are properly compiled, the .ts file shows in the Chrome file tree, but has the same content as the .js file

I've tried compiling using the npm package typescript. I created a test file called Testing.ts and used it to demonstrate the problem:

class Testing{
public static MakeWarn(){
console.log("abc");
}
}

I ran tsc Testing.ts --sourceMap which generated two files

Testing.js

Testing.js.map

The contents are as follows:

Testing.js

var Testing = (function () {
function Testing() {
}
Testing.MakeWarn = function () {
console.log("abc");
};
return Testing;
}());
//# sourceMappingURL=Testing.js.map

Testing.js.map

{"version":3,"file":"Testing.js","sourceRoot":"","sources":["Testing.ts"],"names":[],"mappings":"AAAA;IAAA;IAIA,CAAC;IAHiB,gBAAQ,GAAtB;QACI,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IACL,cAAC;AAAD,CAAC,AAJD,IAIC"}

To my knowledge, these are properly defined .js and .js.map files.

When I open the link in Chrome, I get Testing.self.js and Testing.ts files which both have contents

var Testing = (function () {
function Testing() {
}
Testing.MakeWarn = function () {
console.log("abc");
};
return Testing;
}());
//# sourceMappingURL=Testing.js.map

This is not the expected behaviour. To my understanding, .ts file should look like the original source in Chrome debugger. And I should be able to put a breakpoint.

Expected behavior:

Should have different files for .ts and .js

Actual behavior:

In Chrome and Firefox Developer Edition has the same files for .ts and .js