From 176fe9f113fd912f9b61e848b00bbcfecd6d5c2c Mon Sep 17 00:00:00 2001 From: Arpan Patel Date: Wed, 4 Dec 2024 16:50:10 +0000 Subject: [PATCH] [ci] format --- packages/astro/src/core/build/index.ts | 3 ++- packages/astro/src/core/build/static-build.ts | 22 +++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/packages/astro/src/core/build/index.ts b/packages/astro/src/core/build/index.ts index ced08fecf8f6..68cf650acd0c 100644 --- a/packages/astro/src/core/build/index.ts +++ b/packages/astro/src/core/build/index.ts @@ -211,7 +211,8 @@ class AstroBuilder { key: keyPromise, }; - const { internals, ssrOutputChunkNames, ssrOutputAssetNames, contentFileNames } = await viteBuild(opts); + const { internals, ssrOutputChunkNames, ssrOutputAssetNames, contentFileNames } = + await viteBuild(opts); const hasServerIslands = this.settings.serverIslandNameMap.size > 0; // Error if there are server islands but no adapter provided. diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index d4f6d368fe46..242822613bb4 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -425,17 +425,17 @@ async function ssrMoveAssets(opts: StaticBuildOptions, ssrOutputAssetNames: stri : opts.settings.config.build.server; const clientRoot = opts.settings.config.build.client; if (ssrOutputAssetNames.length > 0) { - await Promise.all( - ssrOutputAssetNames.map(async function moveAsset(filename) { - const currentUrl = new URL(filename, appendForwardSlash(serverRoot.toString())); - const clientUrl = new URL(filename, appendForwardSlash(clientRoot.toString())); - const dir = new URL(path.parse(clientUrl.href).dir); - // It can't find this file because the user defines a custom path - // that includes the folder paths in `assetFileNames` - if (!fs.existsSync(dir)) await fs.promises.mkdir(dir, { recursive: true }); - return fs.promises.rename(currentUrl, clientUrl); - }), - ); + await Promise.all( + ssrOutputAssetNames.map(async function moveAsset(filename) { + const currentUrl = new URL(filename, appendForwardSlash(serverRoot.toString())); + const clientUrl = new URL(filename, appendForwardSlash(clientRoot.toString())); + const dir = new URL(path.parse(clientUrl.href).dir); + // It can't find this file because the user defines a custom path + // that includes the folder paths in `assetFileNames` + if (!fs.existsSync(dir)) await fs.promises.mkdir(dir, { recursive: true }); + return fs.promises.rename(currentUrl, clientUrl); + }), + ); removeEmptyDirs(fileURLToPath(serverRoot)); } }