diff --git a/packages/astro/src/core/build/internal.ts b/packages/astro/src/core/build/internal.ts index d9a21a7de..e51e0e5da 100644 --- a/packages/astro/src/core/build/internal.ts +++ b/packages/astro/src/core/build/internal.ts @@ -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; - if(internals.pagesByClientOnly.has(coPath)) { + if (internals.pagesByClientOnly.has(coPath)) { pageDataSet = internals.pagesByClientOnly.get(coPath)!; } else { pageDataSet = new Set(); @@ -117,8 +117,6 @@ export function trackClientOnlyPageDatas( } } - - export function* getPageDatasByChunk( internals: BuildInternals, chunk: RenderedChunk @@ -136,10 +134,10 @@ export function* getPageDatasByClientOnlyChunk( chunk: RenderedChunk ): Generator { 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; } } diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index 6be7ee4e2..6eaee4eee 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -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 || []), ], diff --git a/packages/astro/test/astro-client-only.test.js b/packages/astro/test/astro-client-only.test.js index dcd7faf17..5e2cc6ce8 100644 --- a/packages/astro/test/astro-client-only.test.js +++ b/packages/astro/test/astro-client-only.test.js @@ -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); - }) + }); });