mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
Disable streaming for SSG (#10796)
This commit is contained in:
parent
1ce22881c6
commit
90669472df
4 changed files with 12 additions and 6 deletions
5
.changeset/eight-hotels-try.md
Normal file
5
.changeset/eight-hotels-try.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"astro": patch
|
||||
---
|
||||
|
||||
Disables streaming when rendering site with `output: "static"`
|
|
@ -53,7 +53,8 @@ export class BuildPipeline extends Pipeline {
|
|||
return assetLink;
|
||||
}
|
||||
const serverLike = isServerLikeOutput(config);
|
||||
const streaming = true;
|
||||
// We can skip streaming in SSG for performance as writing as strings are faster
|
||||
const streaming = serverLike;
|
||||
super(
|
||||
options.logger,
|
||||
manifest,
|
||||
|
|
|
@ -31,6 +31,10 @@ export async function renderToString(
|
|||
let str = '';
|
||||
let renderedFirstPageChunk = false;
|
||||
|
||||
if (isPage) {
|
||||
await bufferHeadContent(result);
|
||||
}
|
||||
|
||||
const destination: RenderDestination = {
|
||||
write(chunk) {
|
||||
// Automatic doctype insertion for pages
|
||||
|
|
|
@ -2,11 +2,7 @@ import * as assert from 'node:assert/strict';
|
|||
import { after, before, describe, it } from 'node:test';
|
||||
import * as cheerio from 'cheerio';
|
||||
import testAdapter from './test-adapter.js';
|
||||
import { isWindows, loadFixture } from './test-utils.js';
|
||||
|
||||
if (!isWindows) {
|
||||
describe();
|
||||
}
|
||||
import { loadFixture } from './test-utils.js';
|
||||
|
||||
describe('Content Collections - render()', () => {
|
||||
describe('Build - SSG', () => {
|
||||
|
|
Loading…
Reference in a new issue