{
  "$schema": "http://json-schema.org/schema",
  "id": "BuildAngularWebpackServerSchema",
  "title": "Universal Target",
  "type": "object",
  "properties": {
    "main": {
      "type": "string",
      "description": "The name of the main entry-point file."
    },
    "tsConfig": {
      "type": "string",
      "default": "tsconfig.app.json",
      "description": "The name of the TypeScript configuration file."
    },
    "stylePreprocessorOptions": {
      "description": "Options to pass to style preprocessors",
      "type": "object",
      "properties": {
        "includePaths": {
          "description": "Paths to include. Paths will be resolved to project root.",
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        }
      },
      "additionalProperties": false
    },
    "optimization": {
      "description": "Enables optimization of the build output. Including minification of scripts and styles, tree-shaking and dead-code elimination. For more information, see https://angular.io/guide/workspace-config#optimization-and-source-map-configuration.",
      "x-user-analytics": 16,
      "default": false,
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "scripts": {
              "type": "boolean",
              "description": "Enables optimization of the scripts output.",
              "default": true
            },
            "styles": {
              "type": "boolean",
              "description": "Enables optimization of the styles output.",
              "default": true
            }
          },
          "additionalProperties": false
        },
        {
          "type": "boolean"
        }
      ]
    },
    "fileReplacements": {
      "description": "Replace compilation source files with other compilation source files in the build.",
      "type": "array",
      "items": {
        "$ref": "#/definitions/fileReplacement"
      },
      "default": []
    },
    "outputPath": {
      "type": "string",
      "description": "Path where output will be placed."
    },
    "resourcesOutputPath": {
      "type": "string",
      "description": "The path where style resources will be placed, relative to outputPath.",
      "default": ""
    },
    "sourceMap": {
      "description": "Output source maps.",
      "default": true,
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "scripts": {
              "type": "boolean",
              "description": "Output source maps for all scripts.",
              "default": true
            },
            "styles": {
              "type": "boolean",
              "description": "Output source maps for all styles.",
              "default": true
            },
            "hidden": {
              "type": "boolean",
              "description": "Output source maps used for error reporting tools.",
              "default": false
            },
            "vendor": {
              "type": "boolean",
              "description": "Resolve vendor packages source maps.",
              "default": false
            }
          },
          "additionalProperties": false
        },
        {
          "type": "boolean"
        }
      ]
    },
    "deployUrl": {
      "type": "string",
      "description": "URL where files will be deployed."
    },
    "verbose": {
      "type": "boolean",
      "description": "Adds more details to output logging.",
      "default": false
    },
    "progress": {
      "type": "boolean",
      "description": "Log progress to the console while building.",
      "default": true
    },
    "i18nFile": {
      "type": "string",
      "description": "Localization file to use for i18n.",
      "x-deprecated": "Use 'locales' object in the project metadata instead."
    },
    "i18nFormat": {
      "type": "string",
      "description": "Format of the localization file specified with --i18n-file.",
      "x-deprecated": "No longer needed as the format will be determined automatically."
    },
    "i18nLocale": {
      "type": "string",
      "description": "Locale to use for i18n.",
      "x-deprecated": "Use 'localize' instead."
    },
    "i18nMissingTranslation": {
      "type": "string",
      "description": "How to handle missing translations for i18n.",
      "enum": ["warning", "error", "ignore"],
      "default": "warning"
    },
    "localize": {
      "description": "Translate the bundles in one or more locales.",
      "oneOf": [
        {
          "type": "boolean",
          "description": "Translate all locales."
        },
        {
          "type": "array",
          "description": "List of locales ID's to translate.",
          "minItems": 1,
          "items": {
            "type": "string",
            "pattern": "^[a-zA-Z]{2,3}(-[a-zA-Z]{4})?(-([a-zA-Z]{2}|[0-9]{3}))?(-[a-zA-Z]{5,8})?(-x(-[a-zA-Z0-9]{1,8})+)?$"
          }
        }
      ]
    },
    "outputHashing": {
      "type": "string",
      "description": "Define the output filename cache-busting hashing mode.",
      "default": "none",
      "enum": [
        "none",
        "all",
        "media",
        "bundles"
      ]
    },
    "deleteOutputPath": {
      "type": "boolean",
      "description": "Delete the output path before building.",
      "default": true
    },
    "preserveSymlinks": {
      "type": "boolean",
      "description": "Do not use the real path when resolving modules. If unset then will default to `true` if NodeJS option --preserve-symlinks is set."
    },
    "extractLicenses": {
      "type": "boolean",
      "description": "Extract all licenses in a separate file, in the case of production builds only.",
      "default": true
    },
    "showCircularDependencies": {
      "type": "boolean",
      "description": "Show circular dependency warnings on builds.",
      "default": true
    },
    "namedChunks": {
      "type": "boolean",
      "description": "Use file name for lazy loaded chunks.",
      "default": true
    },
    "bundleDependencies": {
      "description": "Which external dependencies to bundle into the bundle. By default, all of node_modules will be bundled.",
      "default": true,
      "oneOf": [
        {
          "type": "boolean"
        },
        {
          "type": "string",
          "enum": [
            "none",
            "all"
          ]
        }
      ]
    },
    "externalDependencies": {
      "description": "Exclude the listed external dependencies from being bundled into the bundle. Instead, the created bundle relies on these dependencies to be available during runtime.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "statsJson": {
      "type": "boolean",
      "description": "Generates a 'stats.json' file which can be analyzed using tools such as 'webpack-bundle-analyzer'.",
      "default": false
    },
    "forkTypeChecker": {
      "type": "boolean",
      "description": "Run the TypeScript type checker in a forked process.",
      "default": true
    },
    "lazyModules": {
      "description": "List of additional NgModule files that will be lazy loaded. Lazy router modules will be discovered automatically.",
      "type": "array",
      "items": {
        "type": "string"
      },
      "x-deprecated": "'SystemJsNgModuleLoader' is deprecated, and this is part of its usage. Use 'import()' syntax instead.",
      "default": []
    },
    "watch": {
      "type": "boolean",
      "description": "Run build when files change.",
      "default": false
    },
    "poll": {
      "type": "number",
      "description": "Enable and define the file watching poll time period in milliseconds."
    }
  },
  "additionalProperties": false,
  "required": [
    "outputPath",
    "main",
    "tsConfig"
  ],
  "definitions": {
    "fileReplacement": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "src": {
              "type": "string",
              "pattern": "\\.(([cm]?j|t)sx?|json)$"
            },
            "replaceWith": {
              "type": "string",
              "pattern": "\\.(([cm]?j|t)sx?|json)$"
            }
          },
          "additionalProperties": false,
          "required": [
            "src",
            "replaceWith"
          ]
        },
        {
          "type": "object",
          "properties": {
            "replace": {
              "type": "string",
              "pattern": "\\.(([cm]?j|t)sx?|json)$"
            },
            "with": {
              "type": "string",
              "pattern": "\\.(([cm]?j|t)sx?|json)$"
            }
          },
          "additionalProperties": false,
          "required": [
            "replace",
            "with"
          ]
        }
      ]
    }
  }
}
