How to compile an Angular2 TypeScript application to a single file?

前端 未结 3 731
后悔当初
后悔当初 2021-02-04 13:56

I realize that I can compile my application with tsc my_app.ts --target system and it will generate a SystemJS-wrapped file for each imported module, which is aweso

3条回答
  •  渐次进展
    2021-02-04 14:09

    For the web:

    1. Use the TypeScript compiler to compile to JavaScript.
    2. Use browserify on the JavaScript to combine it to a single file.

    An easier way of doing this though is to use tsify. It's a browserify plugin that compiles TypeScript.

提交回复
热议问题