[ci] format
This commit is contained in:
parent
1687009f31
commit
0f071a9723
3 changed files with 8 additions and 10 deletions
|
@ -102,12 +102,12 @@ export function trackClientOnlyPageDatas(
|
|||
internals: BuildInternals,
|
||||
pageData: PageBuildData,
|
||||
clientOnlys: string[],
|
||||
astroConfig: AstroConfig,
|
||||
astroConfig: AstroConfig
|
||||
) {
|
||||
for(const clientOnlyComponent of clientOnlys) {
|
||||
for (const clientOnlyComponent of clientOnlys) {
|
||||
const coPath = viteID(new URL('.' + clientOnlyComponent, astroConfig.root));
|
||||
let pageDataSet: Set<PageBuildData>;
|
||||
if(internals.pagesByClientOnly.has(coPath)) {
|
||||
if (internals.pagesByClientOnly.has(coPath)) {
|
||||
pageDataSet = internals.pagesByClientOnly.get(coPath)!;
|
||||
} else {
|
||||
pageDataSet = new Set<PageBuildData>();
|
||||
|
@ -117,8 +117,6 @@ export function trackClientOnlyPageDatas(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
export function* getPageDatasByChunk(
|
||||
internals: BuildInternals,
|
||||
chunk: RenderedChunk
|
||||
|
@ -136,10 +134,10 @@ export function* getPageDatasByClientOnlyChunk(
|
|||
chunk: RenderedChunk
|
||||
): Generator<PageBuildData, void, unknown> {
|
||||
const pagesByClientOnly = internals.pagesByClientOnly;
|
||||
if(pagesByClientOnly.size) {
|
||||
if (pagesByClientOnly.size) {
|
||||
for (const [modulePath] of Object.entries(chunk.modules)) {
|
||||
if (pagesByClientOnly.has(modulePath)) {
|
||||
for(const pageData of pagesByClientOnly.get(modulePath)!) {
|
||||
for (const pageData of pagesByClientOnly.get(modulePath)!) {
|
||||
yield pageData;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@ async function ssrBuild(opts: StaticBuildOptions, internals: BuildInternals, inp
|
|||
rollupPluginAstroBuildCSS({
|
||||
internals,
|
||||
legacy: false,
|
||||
target: 'server'
|
||||
target: 'server',
|
||||
}),
|
||||
...(viteConfig.plugins || []),
|
||||
// SSR needs to be last
|
||||
|
@ -223,7 +223,7 @@ async function clientBuild(
|
|||
rollupPluginAstroBuildCSS({
|
||||
internals,
|
||||
legacy: false,
|
||||
target: 'client'
|
||||
target: 'client',
|
||||
}),
|
||||
...(viteConfig.plugins || []),
|
||||
],
|
||||
|
|
|
@ -29,5 +29,5 @@ describe('Client only components', () => {
|
|||
const html = await fixture.readFile('/index.html');
|
||||
const $ = cheerioLoad(html);
|
||||
expect($('link[rel=stylesheet]')).to.have.lengthOf(2);
|
||||
})
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue