{
  "$schema": "https://developer.microsoft.com/json-schemas/heft/v0/heft.schema.json",

  "aliasesByName": {
    "start": {
      "actionName": "build-watch",
      "defaultParameters": ["--serve"]
    }
  },

  "phasesByName": {
    "build": {
      "phaseDescription": "Build and lint the project.",
      "cleanFiles": [
        {
          "sourcePath": "src",
          "fileExtensions": [".resx.ts", ".scss.ts", ".resx.d.ts", ".scss.d.ts"]
        },
        { "includeGlobs": ["dist", "lib", "lib-commonjs", "lib-dts", "lib-esm", "release"] },
        {
          "sourcePath": "temp",
          "includeGlobs": ["generated-code", "loc-ts", "sass-ts", "static-asset-ts", "*.json", "*.md"]
        }
      ],
      "tasksByName": {
        "set-browserslist-ignore-old-data-env-var": {
          "taskPlugin": {
            "pluginPackage": "@rushstack/heft",
            "pluginName": "set-environment-variables-plugin",
            "options": {
              "environmentVariablesToSet": {
                // Suppress the "Browserslist: caniuse-lite is outdated" warning. Although the warning is
                // potentially useful, the check is performed in a way that is nondeterministic and can cause
                // Rush pipelines to fail. Moreover, the outdated version is often irrelevant and/or nontrivial
                // to upgrade. See this thread for details: https://github.com/microsoft/rushstack/issues/2981
                "BROWSERSLIST_IGNORE_OLD_DATA": "1"
              }
            }
          }
        },
        "sass": {
          "taskDependencies": ["set-browserslist-ignore-old-data-env-var"],
          "taskPlugin": {
            "pluginPackage": "@rushstack/heft-sass-plugin"
          }
        },
        "static-asset-typings": {
          "taskPlugin": {
            "pluginPackage": "@rushstack/heft-static-asset-typings-plugin",
            "pluginName": "resource-assets-plugin",
            "options": {
              "configType": "file",
              "configFileName": "static-asset-typings.json"
            }
          }
        },
        "typescript": {
          "taskDependencies": ["sass", "static-asset-typings"],
          "taskPlugin": {
            "pluginPackage": "@rushstack/heft-typescript-plugin"
          }
        },
        "lint": {
          "taskDependencies": ["typescript"],
          "taskPlugin": {
            "pluginPackage": "@rushstack/heft-lint-plugin",
            "options": {
              "sarifLogPath": "release/analysis-logs/lint.sarif"
            }
          }
        },
        "copy-javascript": {
          "taskPlugin": {
            "pluginPackage": "@rushstack/heft",
            "pluginName": "copy-files-plugin",
            "options": {
              "copyOperations": [
                {
                  "sourcePath": "./src",
                  "destinationFolders": ["./lib", "./lib-commonjs"],
                  "fileExtensions": [".js"]
                }
              ]
            }
          }
        },
        "configure-webpack": {
          "taskPlugin": {
            "pluginPackage": "@microsoft/spfx-heft-plugins",
            "pluginName": "spfx-webpack-configuration-plugin"
          }
        },
        "third-party-externals-configure-webpack": {
          "taskDependencies": ["configure-webpack"],
          "taskPlugin": {
            "pluginPackage": "@microsoft/spfx-heft-plugins",
            "pluginName": "third-party-externals-plugin"
          }
        },
        "configure-webpack-serve": {
          "taskPlugin": {
            "pluginPackage": "@microsoft/spfx-heft-plugins",
            "pluginName": "spfx-webpack-serve-configuration-plugin"
          }
        },
        "customize-configure-webpack": {
          "taskPlugin": {
            "pluginPackage": "@microsoft/spfx-heft-plugins",
            "pluginName": "customize-spfx-webpack-configuration-plugin",
            "options": {
              "customizationFilename": "spfx-customize-webpack.js"
            }
          }
        },
        "webpack-patch": {
          "taskDependencies": ["customize-configure-webpack", "third-party-externals-configure-webpack"],
          "taskPlugin": {
            "pluginPackage": "@microsoft/spfx-heft-plugins",
            "pluginName": "webpack-patch-plugin"
          }
        },
        "webpack": {
          "taskDependencies": ["webpack-patch", "typescript", "sass", "copy-javascript"],
          "taskPlugin": {
            "pluginPackage": "@rushstack/heft-webpack5-plugin"
          }
        }
      }
    },

    "test": {
      "phaseDescription": "Run tests against the project using Jest.",
      "phaseDependencies": ["build"],
      "cleanFiles": [{ "sourcePath": "jest-output" }],
      "tasksByName": {
        "jest": {
          "taskPlugin": {
            "pluginPackage": "@rushstack/heft-jest-plugin"
          }
        }
      }
    },

    "eject-webpack": {
      "phaseDescription": "Eject the webpack configuration to a webpack.config.js file.",
      "tasksByName": {
        "eject-webpack": {
          "taskPlugin": {
            "pluginPackage": "@microsoft/spfx-heft-plugins",
            "pluginName": "spfx-eject-webpack-configuration-plugin"
          }
        }
      }
    },

    "package-solution": {
      "phaseDescription": "Package the project into a SPPKG",
      "tasksByName": {
        "package-solution": {
          "taskPlugin": {
            "pluginPackage": "@microsoft/spfx-heft-plugins",
            "pluginName": "package-solution-plugin"
          }
        }
      }
    },

    "deploy-azure-storage": {
      "phaseDescription": "Deploy the project to Azure Storage",
      "tasksByName": {
        "deploy-azure-storage": {
          "taskPlugin": {
            "pluginPackage": "@microsoft/spfx-heft-plugins",
            "pluginName": "deploy-azure-storage-plugin"
          }
        }
      }
    },

    "dev-deploy": {
      "phaseDescription": "Deploys files to a testing CDN.",
      "tasksByName": {
        "dev-deploy": {
          "taskPlugin": {
            "pluginPackage": "@microsoft/spfx-heft-plugins",
            "pluginName": "spfx-dev-deploy-plugin"
          }
        }
      }
    },

    "trust-dev-cert": {
      "tasksByName": {
        "trust-dev-cert": {
          "taskPlugin": {
            "pluginPackage": "@rushstack/heft-dev-cert-plugin",
            "pluginName": "trust-dev-certificate-plugin"
          }
        }
      }
    },

    "untrust-dev-cert": {
      "tasksByName": {
        "untrust-dev-cert": {
          "taskPlugin": {
            "pluginPackage": "@rushstack/heft-dev-cert-plugin",
            "pluginName": "untrust-dev-certificate-plugin"
          }
        }
      }
    }
  }
}
