Currently, I am consolidating all my .ts
files into a single file using the following command:
tsc -out app.js app.ts --removeComments
This is based on the instructions provided in the npm documentation. However, even after compilation, all reference tags are retained in the generated code. From what I understand, there is no practical use for these in JavaScript.
For instance, consider the TypeScript files below:
Application.ts
/// <reference path="../references/backbone.d.ts" />
module Example {
export class Application extends Backbone.View<Backbone.Model> {
...
}
}
and
app.ts
/// <reference path="Example/Application.ts" />
import Application = Example.Application;
class App extends Application {
...
}
after compilation, they result in something similar to:
/// <reference path="../references/backbone.d.ts" />
var __extends = (this && this.__extends) || function (d, b) {
...
};
var Example;
(function (Example) {
var Application = (function (_super) {
...
})(Backbone.View);
Example.Application = Application;
})(Example || (Example = {}));
/// <reference path="Example/Application.ts" />
var Application = Example.Application;
var App = (function (_super) {
...
})(Application);
//# sourceMappingURL=app.js.map
While I definitely want the sourceMappingURL
included, the --removeComments
flag does not eliminate the reference tags. Are these tags necessary in debugging scenarios with source maps? Is there an option to exclude them from the compiled output?