Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
angular cli的所有typeScript outDir选项的用途_Angular_Typescript_Angular Cli - Fatal编程技术网

angular cli的所有typeScript outDir选项的用途

angular cli的所有typeScript outDir选项的用途,angular,typescript,angular-cli,Angular,Typescript,Angular Cli,在angular cli中使用多个outDir选项的目的是什么 我的意思是,有: /.angular cli.json中的outDir(这是ng构建将构建文件放入的文件夹) /tsconfig.json中的outDir(这显然是无用的,因为此文件仅由/src/tsconfig.xxx.json文件扩展,并且它们覆盖了此选项) 每个/src/tsconfig.xxx.json中都有一个outDir(这对我来说从来都不起作用,我从来没有看到在指定的路径中生成任何文件…) 依我看,只有第一个(来自

在angular cli中使用多个
outDir
选项的目的是什么

我的意思是,有:


  • /.angular cli.json
    中的
    outDir
    (这是
    ng构建
    将构建文件放入的文件夹)

  • /tsconfig.json
    中的
    outDir
    (这显然是无用的,因为此文件仅由
    /src/tsconfig.xxx.json
    文件扩展,并且它们覆盖了此选项)
  • 每个
    /src/tsconfig.xxx.json中都有一个
    outDir
    (这对我来说从来都不起作用,我从来没有看到在指定的路径中生成任何文件…)
依我看,只有第一个(来自
/.angular cli.json
)被使用,其他的完全没有用

但我想angular团队没有明确说明他们的目的


有人能给我解释一下吗?
中的
outDir
tsconfig.json中的
outDir
是完全分开的。第一个是构建工件(webpack输出包等)的位置;您可以从此目录为应用程序提供服务
tsconfig.json
是关于
tsc
及其输出(
*.ts
)文件的位置。使用哪个
outDir
从哪个
tsconfig.*.json
取决于您的特定配置。例如,您可能希望TS将测试文件编译到不同的位置,并且在应用程序中使用
tsconfig.xxx.json
。您可以有几个应用程序,第一个
tsconfig.json
将是项目的TypeScript配置,而其他的将是应用程序的TypeScript配置。@torazaburo-Thx。这是有道理的。但是当我使用
ngserve
时,我仍然不明白为什么在out-tsc文件夹(在tsconfig.xxx.json中指定)中看不到任何文件。。。无论是
ng测试
,它们都不是中间工件。如果您只运行
tsc
命令,就会看到它们。