-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: improve production build logging (#2857)
* feat: log setup, vite, and route gen steps * refactor: add back "build" + timestamp for consistency * feat: improve ms increase logs to match old debug output * feat: add log for server assets * chore: remove redundant debug logs * feat: add logs for ssr steps * fix: hide per-page log for ssr builds * fix: hide "index.html" from debug log in SSR * feat: add log for "collecting page data" step * feat: add timeout logs for longer data imports * chore: add changeset * remove (includes setup + teardown) * refactor: add newline to separate ssr from client build * fix: move "gen static routes" heading to pages * fix: only show client build ms when triggered * fix: remove dup render loop * chore: remove unused static-build imports
- Loading branch information
1 parent
5571227
commit 1061d64
Showing
6 changed files
with
108 additions
and
14 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,9 @@ | ||
--- | ||
'astro': patch | ||
--- | ||
|
||
Improve granularity of production build logs. This now lists: | ||
- the "data collection" build step, with timeout warnings for larger imports. This is useful for understanding large `import.meta.glob` calls. | ||
- the Vite client bundling step. This logs all Vite production build info to clarify what assets are built alongside your HTML. | ||
- the route generation step, complete with all output HTML files for a given input file. This is especially useful when debugging `getStaticPaths`. | ||
- fixes "0 pages in Infinityms" log when building to SSR |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export function getTimeStat(timeStart: number, timeEnd: number) { | ||
const buildTime = timeEnd - timeStart; | ||
return buildTime < 750 ? `${Math.round(buildTime)}ms` : `${(buildTime / 1000).toFixed(2)}s`; | ||
} |