<!--
title: Parameterize build processes
domain: app-frameworks
topic: CI/CD
language: Json
source: mui/material-ui
updated: 2025-02-26
url: https://awesomereviewers.com/reviewers/material-ui-parameterize-build-processes/
-->

When designing build scripts for multi-package repositories, use parameterization to handle special cases rather than creating duplicate scripts with minor variations. This approach maintains consistency while accommodating package-specific needs. For example, instead of hardcoding different behaviors, add flags that can modify behavior:

```json
"scripts": {
  "build": "standard-build-script --skipEsmPkg",
  "build:esm-pkg": "node ./scripts/create-esm-package-json.mjs"
}
```

Similarly, prefer built-in parameterization of tools (like pnpm's `--dry-run` flag) over custom implementations for common CI/CD operations. This improves maintainability and leverages well-tested functionality.
