In my current project using Next.js with TypeScript in a mono-repo setup, I have multiple applications under the same repository. When pushing changes to this setup, various hooks are triggered locally to ensure that the modifications meet the required standards - passing tests and successful builds.
Despite these validations, the build process for our application is time-consuming, and any errors tend to occur early on in the process.
For building a specific application, I use nx build my-application
, which involves steps such as:
- Checking type validity
- Generating an optimized production build
- Gathering page data
- ...
If there is an issue, the initial step of checking types (performed by TypeScript) typically fails quickly (<15 seconds), prompting me to consider running this step independently.
Therefore, my query is: Is it possible to only run the first step to validate types without proceeding through the entire build process? Despite reviewing the build
command in the Next.js documentation, I couldn't find a direct solution.