-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support parallel builds (#11984)
* 支持并发生成 * feat: Add support parallel builds * feat: read concurrency config * changeset * fix: Explicit undefined is unnecessary on an optional parameter * pnpm-lock.yaml rebuild * fix: add innerPrevTimeEnd * fix: modification time calculation * update pnpm-lock.yaml * Rewrite with p-limit * update * clean * Update changeset * typo [skip ci] * Apply suggestions from code review Co-authored-by: Sarah Rainsberger <[email protected]> * Apply suggestions from code review Co-authored-by: Sarah Rainsberger <[email protected]> * Update packages/astro/src/core/config/schema.ts * formatting * merge main and update the lock file * Update packages/astro/src/@types/astro.ts Co-authored-by: Sarah Rainsberger <[email protected]> * Update packages/astro/src/@types/astro.ts Co-authored-by: Sarah Rainsberger <[email protected]> * Apply suggestions from code review Co-authored-by: Sarah Rainsberger <[email protected]> --------- Co-authored-by: bluwy <[email protected]> Co-authored-by: Emanuele Stoppa <[email protected]> Co-authored-by: Sarah Rainsberger <[email protected]>
- Loading branch information
1 parent
116c533
commit 3ac2263
Showing
5 changed files
with
878 additions
and
658 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
'astro': minor | ||
--- | ||
|
||
Adds a new `build.concurreny` configuration option to specify the number of pages to build in parallel | ||
|
||
**In most cases, you should not change the default value of `1`.** | ||
|
||
Use this option only when other attempts to reduce the overall rendering time (e.g. batch or cache long running tasks like fetch calls or data access) are not possible or are insufficient. | ||
|
||
Use this option only if the refactors are not possible. If the number is set too high, the page rendering may slow down due to insufficient memory resources and because JS is single-threaded. | ||
|
||
> [!WARNING] | ||
> This feature is stable and is not considered experimental. However, this feature is only intended to address difficult performance issues, and breaking changes may occur in a [minor release](https://docs.astro.build/en/upgrade-astro/#semantic-versioning) to keep this option as performant as possible. | ||
```js | ||
// astro.config.mjs | ||
import { defineConfig } from 'astro'; | ||
|
||
export default defineConfig({ | ||
build: { | ||
concurrency: 2, | ||
}, | ||
}); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.