[ci] format
This commit is contained in:
parent
e4025d1f53
commit
f5b48bc0ae
13 changed files with 46 additions and 50 deletions
|
@ -95,8 +95,8 @@ export class App {
|
|||
status: 200,
|
||||
headers: {
|
||||
'Content-Type': 'text/html',
|
||||
'Content-Length': bytes.byteLength.toString()
|
||||
}
|
||||
'Content-Length': bytes.byteLength.toString(),
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -126,7 +126,7 @@ export class App {
|
|||
headers.set('Content-Length', bytes.byteLength.toString());
|
||||
return new Response(bytes, {
|
||||
status: 200,
|
||||
headers
|
||||
headers,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,6 @@ export function trackPageData(internals: BuildInternals, component: string, page
|
|||
internals.pagesByViteID.set(viteID(componentURL), pageData);
|
||||
}
|
||||
|
||||
|
||||
export function* getPageDatasByChunk(internals: BuildInternals, chunk: RenderedChunk): Generator<PageBuildData, void, unknown> {
|
||||
const pagesByViteID = internals.pagesByViteID;
|
||||
for (const [modulePath] of Object.entries(chunk.modules)) {
|
||||
|
|
|
@ -150,8 +150,7 @@ async function ssrBuild(opts: StaticBuildOptions, internals: BuildInternals, inp
|
|||
}),
|
||||
...(viteConfig.plugins || []),
|
||||
// SSR needs to be last
|
||||
isBuildingToSSR(opts.astroConfig) &&
|
||||
vitePluginSSR(opts, internals, opts.astroConfig._ctx.adapter!),
|
||||
isBuildingToSSR(opts.astroConfig) && vitePluginSSR(opts, internals, opts.astroConfig._ctx.adapter!),
|
||||
],
|
||||
publicDir: ssr ? false : viteConfig.publicDir,
|
||||
root: viteConfig.root,
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
import type { Plugin as VitePlugin } from 'vite';
|
||||
import type { BuildInternals } from './internal.js';
|
||||
import type { StaticBuildOptions } from './types';
|
||||
|
@ -42,7 +41,7 @@ export function vitePluginPages(opts: StaticBuildOptions, internals: BuildIntern
|
|||
for (const renderer of opts.astroConfig._ctx.renderers) {
|
||||
const variable = `_renderer${i}`;
|
||||
imports.push(`import ${variable} from '${renderer.serverEntrypoint}';`);
|
||||
rendererItems += `Object.assign(${JSON.stringify(renderer)}, { ssr: ${variable} }),`
|
||||
rendererItems += `Object.assign(${JSON.stringify(renderer)}, { ssr: ${variable} }),`;
|
||||
i++;
|
||||
}
|
||||
|
||||
|
@ -53,6 +52,6 @@ export const renderers = [${rendererItems}];`;
|
|||
|
||||
return def;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
@ -239,4 +239,3 @@ This file is in BETA. Please test and contribute to the discussion:
|
|||
</html>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>`;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ describe('API routes in SSR', () => {
|
|||
buildOptions: {
|
||||
experimentalSsr: true,
|
||||
},
|
||||
adapter: testAdapter()
|
||||
adapter: testAdapter(),
|
||||
});
|
||||
await fixture.build();
|
||||
});
|
||||
|
|
|
@ -91,7 +91,7 @@ export async function loadFixture(inlineConfig) {
|
|||
const url = new URL('./server/entry.mjs', config.dist);
|
||||
const { createApp } = await import(url);
|
||||
return createApp();
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ async function writeWebResponse(res: ServerResponse, webResponse: Response) {
|
|||
const { status, headers, body } = webResponse;
|
||||
res.writeHead(status, Object.fromEntries(headers.entries()));
|
||||
if (body) {
|
||||
for await(const chunk of (body as unknown as Readable)) {
|
||||
for await (const chunk of body as unknown as Readable) {
|
||||
res.write(chunk);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue