且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何连接我的 angular2 应用程序 javascript 文件

更新时间:2023-11-22 20:12:47

其实你不能自己concat typescript编译器生成的js文件.

In fact you can't concat js files by your own that are generated by the typescript compiler.

如果您想将它们全部放在一个文件中,则需要在 tsconfig.json 文件中利用编译器的 outFile 属性:

If you want to have all of them in a single file, you need to leverage the outFile property of the compiler in the tsconfig.json file:

{
  "compilerOptions": {
    "target": "ES5",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false,
    "outFile": "app.js" <-------
  },
  "exclude": [
    "node_modules"
  ]
}