{
  "title": "Web Library Package Target (Experimental)",
  "description": "Packages a library for web different web usages (UMD, ESM, CJS).",
  "cli": "nx",
  "type": "object",
  "properties": {
    "project": {
      "type": "string",
      "description": "The path to package.json file."
    },
    "entryFile": {
      "type": "string",
      "description": "The path to the entry file, relative to project."
    },
    "outputPath": {
      "type": "string",
      "description": "The output path of the generated files."
    },
    "deleteOutputPath": {
      "type": "boolean",
      "description": "Delete the output path before building.",
      "default": true
    },
    "tsConfig": {
      "type": "string",
      "description": "The path to tsconfig file."
    },
    "external": {
      "type": "array",
      "description": "A list of external modules that will not be bundled (react, react-dom, etc.).",
      "items": {
        "type": "string"
      }
    },
    "watch": {
      "type": "boolean",
      "description": "Enable re-building when files change.",
      "default": false
    },
    "updateBuildableProjectDepsInPackageJson": {
      "type": "boolean",
      "description": "Update buildable project dependencies in package.json",
      "default": true
    },
    "buildableProjectDepsInPackageJsonType": {
      "type": "string",
      "description": "When updateBuildableProjectDepsInPackageJson is true, this adds dependencies to either `peerDependencies` or `dependencies`",
      "enum": ["dependencies", "peerDependencies"],
      "default": "peerDependencies"
    },
    "rollupConfig": {
      "type": "string",
      "description": "Path to a function which takes a rollup config and returns an updated rollup config"
    },
    "babelConfig": {
      "type": "string",
      "description": "(deprecated) Path to a function which takes a babel config and returns an updated babel config"
    },
    "umdName": {
      "type": "string",
      "description": "The name of your module in UMD format. Defaulted to your project name."
    },
    "globals": {
      "description": "A mapping of node modules to their UMD global names. Used by the UMD bundle",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "moduleId": {
            "type": "string",
            "description": "The node module to map from (e.g. `react-dom`)."
          },
          "global": {
            "type": "string",
            "description": "The global name to map to (e.g. `ReactDOM`)."
          }
        },
        "additionalProperties": false,
        "required": ["moduleId", "global"]
      },
      "default": []
    },
    "extractCss": {
      "type": "boolean",
      "description": "CSS files will be extracted to the output folder.",
      "default": true
    },
    "assets": {
      "type": "array",
      "description": "List of static assets.",
      "default": [],
      "items": {
        "$ref": "#/definitions/assetPattern"
      }
    }
  },
  "required": ["tsConfig", "project", "entryFile", "outputPath"],

  "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."
            },
            "output": {
              "type": "string",
              "description": "Relative path within the output folder."
            }
          },
          "additionalProperties": false,
          "required": ["glob", "input", "output"]
        },
        {
          "type": "string"
        }
      ]
    }
  }
}
