0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-30 22:03:56 -05:00

[ci] format

This commit is contained in:
Arpan Patel 2024-12-04 16:50:10 +00:00 committed by astrobot-houston
parent e6b8017239
commit 176fe9f113
2 changed files with 13 additions and 12 deletions

View file

@ -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.

View file

@ -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));
}
}