{
  "title": "Node Application Build Target",
  "description": "Node application build target options for Build Facade",
  "type": "object",
  "properties": {
    "dev": {
      "type": "boolean",
      "description": "Build the application for development mode",
      "default": true
    },
    "main": {
      "type": "string",
      "description": "The path to the main entry-point file."
    },
    "otherEntries": {
      "type": "object",
      "description": "Additional entries that you want to define. The key is the name of the file and the value is the entry. Each of these entries becomes an independently executable bundle."
    },
    "tsConfig": {
      "type": "string",
      "description": "The name of the Typescript configuration file."
    },
    "watch": {
      "type": "boolean",
      "description": "Run build when files change.",
      "default": false
    },
    "poll": {
      "type": "number",
      "description": "Frequency of file watcher in ms."
    },
    "sourceMap": {
      "type": "boolean",
      "description": "Produce source maps. This flag is only used when dev=false. When dev=true, source maps are always produced.",
      "default": true
    },
    "progress": {
      "type": "boolean",
      "description": "Log progress to the console while building. Only works for dev=true.",
      "default": true
    },
    "notifier": {
      "description": "Pops up a notifier when the build is done. Works only in dev=true mode. If set to true, all notifications will be shown. Otherwise, you can configure options for it (see schema or https://github.com/johnnyreilly/fork-ts-checker-notifier-webpack-plugin).",
      "oneOf": [
        {
          "type": "boolean"
        },
        {
          "type": "object",
          "properties": {
            "excludeWarnings": {
              "type": "boolean",
              "description": "If set to true, warnings will not cause a notification.",
              "default": false
            },
            "alwaysNotify": {
              "type": "boolean",
              "description": "Trigger a notification every time. Call it \"noisy-mode\".",
              "default": false
            },
            "skipFirstNotification": {
              "type": "boolean",
              "description": "Do not notify on the first build. This allows you to receive notifications on subsequent incremental builds without being notified on the initial build.",
              "default": false
            },
            "skipSuccessful": {
              "type": "boolean",
              "description": "Skip notifications for successful builds.",
              "default": true
            }
          }
        }
      ],
      "default": true
    },
    "envFolderPath": {
      "type": "string",
      "description": "The path to the folder that contains this project's .env environment files."
    },
    "additionalEnvFile": {
      "type": "string",
      "description": "The path to an additional environment file. This will be loaded first before any others for the NODE_ENV are loaded, and will take priority over all others."
    },
    "assets": {
      "type": "array",
      "description": "List of static application assets.",
      "default": [],
      "items": {
        "$ref": "#/definitions/assetPattern"
      }
    },
    "externalDependencies": {
      "oneOf": [
        {
          "type": "string",
          "enum": ["none", "all"]
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "node_module dependencies to keep external to the bundle. (\"all\" (default), \"none\", or an array of module names)",
      "default": "all"
    },
    "externalLibraries": {
      "oneOf": [
        {
          "type": "string",
          "enum": ["none", "all"]
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ],
      "description": "Libraries within the mono-repo to keep external to the bundle. (\"all\" (default), \"none\", or an array of library names.)",
      "default": "none"
    },
    "statsJson": {
      "type": "boolean",
      "description": "Generates a 'stats.json' file which can be analyzed using tools such as: #webpack-bundle-analyzer' or https: //webpack.github.io/analyse.",
      "default": false
    },
    "verbose": {
      "type": "boolean",
      "description": "Emits verbose output",
      "default": false
    },
    "extractLicenses": {
      "type": "boolean",
      "description": "Extract all licenses in a separate file, in the case of production builds only.",
      "default": false
    },
    "buildCacheFolder": {
      "type": "string",
      "description": "A path relative to the root of this workspace for storing webpack and typescript caches"
    },
    "showCircularDependencies": {
      "type": "boolean",
      "description": "Show circular dependency warnings on builds.",
      "default": true
    },
    "fileReplacements": {
      "description": "Replace files with other files in the build.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "replace": {
            "type": "string"
          },
          "with": {
            "type": "string"
          }
        },
        "additionalProperties": false,
        "required": ["replace", "with"]
      },
      "default": []
    },
    "webpackConfig": {
      "type": "string",
      "description": "Path to a function which takes a webpack config, context and returns the resulting webpack config"
    }
  },
  "required": ["tsConfig", "main"],
  "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"
        }
      ]
    }
  }
}
