1.

What are triple-slash directives?

Answer»

Triple-slash directives are single-line comments that contain a single XML tag. TypeScript uses this XML tag as a compiler directive.

You can only place a triple-slash directive at the top of the containing file. Only single or multi-line comments can come before a triple-slash directive. TypeScript treats them as regular comments if it occurs in the middle of a code block, after a statement.

The primary USE of triple-slash directives is to include other files in the compilation process. For EXAMPLE, the following directive instructs the compiler to include a file specified by the path in the containing TypeScript file.

/// <REFERENCE path="..." />

Triple-slash directives also ORDER the output when using --out or --outFile. The output files are produced to the output file location in the same order as the input files.



Discussion

No Comment Found