diff options
author | 2022-04-14 16:20:04 +0000 | |
---|---|---|
committer | 2022-04-14 16:20:04 +0000 | |
commit | 0f071a9723961a9a53602744bf10207040d2daaf (patch) | |
tree | a562eec76cc5440a3d989861a3cd34e217863adc | |
parent | 1687009f31fa23f193cbbf95fd018a51f3f3c671 (diff) | |
download | astro-0f071a9723961a9a53602744bf10207040d2daaf.tar.gz astro-0f071a9723961a9a53602744bf10207040d2daaf.tar.zst astro-0f071a9723961a9a53602744bf10207040d2daaf.zip |
[ci] format
-rw-r--r-- | packages/astro/src/core/build/internal.ts | 12 | ||||
-rw-r--r-- | packages/astro/src/core/build/static-build.ts | 4 | ||||
-rw-r--r-- | packages/astro/test/astro-client-only.test.js | 2 |
3 files changed, 8 insertions, 10 deletions
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<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; } } 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); - }) + }); }); |