{
  "version": 2,
  "outputCapture": "direct-nodejs",
  "$schema": "https://json-schema.org/schema",
  "cli": "nx",
  "title": "Typescript Build Target",
  "description": "Builds using SWC.",
  "type": "object",
  "properties": {
    "main": {
      "type": "string",
      "description": "The name of the main entry-point file.",
      "x-completion-type": "file",
      "x-completion-glob": "main@(.js|.ts|.tsx)",
      "x-priority": "important"
    },
    "generateExportsField": {
      "type": "boolean",
      "alias": "exports",
      "description": "Update the output package.json file's 'exports' field. This field is used by Node and bundles.",
      "x-priority": "important",
      "default": false
    },
    "additionalEntryPoints": {
      "type": "array",
      "description": "Additional entry-points to add to exports field in the package.json file.",
      "items": {
        "type": "string"
      },
      "x-priority": "important"
    },
    "outputPath": {
      "type": "string",
      "description": "The output path of the generated files.",
      "x-completion-type": "directory",
      "x-priority": "important"
    },
    "tsConfig": {
      "type": "string",
      "description": "The path to the Typescript configuration file.",
      "x-completion-type": "file",
      "x-completion-glob": "tsconfig.*.json",
      "x-priority": "important"
    },
    "swcrc": {
      "type": "string",
      "description": "The path to the SWC configuration file. Default: .swcrc",
      "x-completion-type": "file",
      "x-completion-glob": ".swcrc"
    },
    "assets": {
      "type": "array",
      "description": "List of static assets.",
      "default": [],
      "items": {
        "$ref": "#/definitions/assetPattern"
      }
    },
    "watch": {
      "type": "boolean",
      "description": "Enable re-building when files change.",
      "default": false
    },
    "clean": {
      "type": "boolean",
      "description": "Remove previous output before build.",
      "default": true
    },
    "skipTypeCheck": {
      "type": "boolean",
      "description": "Whether to skip TypeScript type checking.",
      "default": false,
      "x-priority": "important"
    },
    "swcExclude": {
      "type": "array",
      "description": "List of SWC Glob/Regex to be excluded from compilation (https://swc.rs/docs/configuration/compilation#exclude).",
      "default": [
        "./src/**/.*.spec.ts$",
        "./**/.*.spec.ts$",
        "./src/**/jest-setup.ts$",
        "./**/jest-setup.ts$",
        "./**/.*.js$"
      ],
      "hidden": true
    },
    "external": {
      "description": "A list projects to be treated as external. This feature is experimental",
      "oneOf": [
        {
          "type": "string",
          "enum": ["all", "none"]
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "x-deprecated": "Make sure all dependencies are buildable by running `nx g @nx/js:setup-build`. This option will be removed in Nx 20."
    },
    "externalBuildTargets": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "List of target names that annotate a build target for a project",
      "default": ["build"]
    },
    "generateLockfile": {
      "type": "boolean",
      "description": "Generate a lockfile (e.g. package-lock.json) that matches the workspace lockfile to ensure package versions match.",
      "default": false,
      "x-priority": "internal"
    }
  },
  "stripLeadingPaths": {
    "type": "boolean",
    "description": "Remove leading directory from output (e.g. src). See: https://swc.rs/docs/usage/cli#--strip-leading-paths",
    "default": false
  },
  "required": ["main", "outputPath", "tsConfig"],
  "definitions": {
    "assetPattern": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "glob": {
              "type": "string",
              "description": "The pattern to match."
            },
            "input": {
              "type": "string",
              "description": "The input directory path in which to apply 'glob'. Defaults to the project root."
            },
            "ignore": {
              "description": "An array of globs to ignore.",
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "output": {
              "type": "string",
              "description": "Absolute path within the output."
            }
          },
          "additionalProperties": false,
          "required": ["glob", "input", "output"]
        },
        {
          "type": "string"
        }
      ]
    }
  },
  "examplesFile": "../../../docs/swc-examples.md"
}
