How can I pass multiple source files to the TypeScript compiler?

后端 未结 6 1266
忘掉有多难
忘掉有多难 2020-12-14 05:54

TypeScript is designed for large-scale JavaScripty projects which typically consist of multiple internally produced files along with externally produced libraries. How does

6条回答
  •  悲&欢浪女
    2020-12-14 06:30

    tsc can compile multiple sources in sequence if you just give the names in order:

    tsc foo.ts bar.ts
    

    You can also pass a text file containing a list of files and command line arguments from a text file using the @ command line argument.

    tsc @compile.txt
    

    and the compile.txt could look like this:

    --module amd
    foo.ts
    bar.ts
    

    Also note that if on file references another via an import, tsc will automatically figure that out without you having to explicitly list the file that it depends on.

提交回复
热议问题