mirror of
https://github.com/withastro/astro.git
synced 2024-12-30 22:03:56 -05:00
[ci] format
This commit is contained in:
parent
e6b8017239
commit
176fe9f113
2 changed files with 13 additions and 12 deletions
|
@ -211,7 +211,8 @@ class AstroBuilder {
|
||||||
key: keyPromise,
|
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;
|
const hasServerIslands = this.settings.serverIslandNameMap.size > 0;
|
||||||
// Error if there are server islands but no adapter provided.
|
// Error if there are server islands but no adapter provided.
|
||||||
|
|
|
@ -425,17 +425,17 @@ async function ssrMoveAssets(opts: StaticBuildOptions, ssrOutputAssetNames: stri
|
||||||
: opts.settings.config.build.server;
|
: opts.settings.config.build.server;
|
||||||
const clientRoot = opts.settings.config.build.client;
|
const clientRoot = opts.settings.config.build.client;
|
||||||
if (ssrOutputAssetNames.length > 0) {
|
if (ssrOutputAssetNames.length > 0) {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
ssrOutputAssetNames.map(async function moveAsset(filename) {
|
ssrOutputAssetNames.map(async function moveAsset(filename) {
|
||||||
const currentUrl = new URL(filename, appendForwardSlash(serverRoot.toString()));
|
const currentUrl = new URL(filename, appendForwardSlash(serverRoot.toString()));
|
||||||
const clientUrl = new URL(filename, appendForwardSlash(clientRoot.toString()));
|
const clientUrl = new URL(filename, appendForwardSlash(clientRoot.toString()));
|
||||||
const dir = new URL(path.parse(clientUrl.href).dir);
|
const dir = new URL(path.parse(clientUrl.href).dir);
|
||||||
// It can't find this file because the user defines a custom path
|
// It can't find this file because the user defines a custom path
|
||||||
// that includes the folder paths in `assetFileNames`
|
// that includes the folder paths in `assetFileNames`
|
||||||
if (!fs.existsSync(dir)) await fs.promises.mkdir(dir, { recursive: true });
|
if (!fs.existsSync(dir)) await fs.promises.mkdir(dir, { recursive: true });
|
||||||
return fs.promises.rename(currentUrl, clientUrl);
|
return fs.promises.rename(currentUrl, clientUrl);
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
removeEmptyDirs(fileURLToPath(serverRoot));
|
removeEmptyDirs(fileURLToPath(serverRoot));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue