是否可以将构建文件与 nx 构建节点分开?

Is it possible to separate build files with nx build node?

我有一个带有 nx 工作区的节点 js 项目,我的问题是我的下载和上传路径带有路径,例如 const filePath = path.join(__dirname, '../../templates', fileName)。当我运行

nx run build

nx 将所有文件合并到一个 main.js 文件中,这毁了我的路径,我的应用程序不再找到模板,因为它只有一个文件夹,而不是 2。我应该怎么做才能告诉 nx build 构建我的像正常应用程序一样,没有将我的所有文件合并到一个文件中?

我制作了自定义脚本:

   "start": {
      "executor": "@nrwl/workspace:run-commands",
      "options": {
        "commands": [
          "nodemon -e ts,graphql --exec \"nx run server-authentication:start-nodemon\""
        ],
        "cwd": "apps/server/authentication",
        "parallel": false
      }
    },
    "start-nodemon": {
      "executor": "@nrwl/workspace:run-commands",
      "options": {
        "commands": [
          "nx run server-authentication:ts-build",
          "node ../../../../dist/apps/server/authentication/src/index.js"
        ],
        "cwd": "apps/server/authentication",
        "parallel": false
      }
    },
    "ts-build": {
      "executor": "@nrwl/workspace:run-commands",
      "options": {
        "commands": [
          "tsc -p tsconfig.app.json",
          "tsc-alias -p tsconfig.app.json",
          "ncp src/schema ../../../../dist/apps/server/authentication/src/schema",
          "ncp .env ../../../../dist/apps/server/authentication/src/.env"
        ],
        "cwd": "apps/server/authentication",
        "parallel": false
      }
    },