如何使打字稿编译器不维护 dist 文件夹中的文件路径?

问题描述 投票:0回答:0

我向

NX
monorepo 添加了自定义命令。该命令应将我的实体编译到相同的
dist
目录。

问题是当命令运行时,在

dist
内部它会创建相应的路径。例如:

apps/api-identity/project.json

"compile-entities": {
  "executor": "nx:run-commands",
  "options": {
    "commands": ["npx tsc --p ./tsconfig.entities.json"]
  },
  "outputPath": "dist/apps/api-identity"
},

tsconfig.entities.json

{
  "extends": "./tsconfig.base.json",
  "compilerOptions": {
    "outDir": "dist",
    "module": "commonjs",
    "types": ["node"],
    "emitDecoratorMetadata": true,
    "target": "es2015",
  },
  "include": ["apps/**/*.entity.ts"]
}

这就是

/dist
文件夹结构现在的样子:

这就是我需要达到的结果:

有什么想法吗?

typescript tsconfig tsc nrwl-nx
© www.soinside.com 2019 - 2024. All rights reserved.