[ci] yarn format

This commit is contained in:
matthewp 2022-01-31 21:30:29 +00:00 committed by GitHub Actions
parent d8b50c9e68
commit de9ab4f306

View file

@ -224,7 +224,7 @@ async function clientBuild(opts: StaticBuildOptions, internals: BuildInternals,
root: viteConfig.root,
envPrefix: 'PUBLIC_',
server: viteConfig.server,
base: appendForwardSlash(astroConfig.buildOptions.site ? (new URL(astroConfig.buildOptions.site)).pathname : '/'),
base: appendForwardSlash(astroConfig.buildOptions.site ? new URL(astroConfig.buildOptions.site).pathname : '/'),
});
}
@ -383,8 +383,7 @@ async function generatePath(pathname: string, opts: StaticBuildOptions, gopts: G
}
function getOutRoot(astroConfig: AstroConfig): URL {
const rootPathname = appendForwardSlash(astroConfig.buildOptions.site ?
new URL(astroConfig.buildOptions.site).pathname : '/');
const rootPathname = appendForwardSlash(astroConfig.buildOptions.site ? new URL(astroConfig.buildOptions.site).pathname : '/');
return new URL('.' + rootPathname, astroConfig.dist);
}
@ -392,16 +391,20 @@ function getOutFolder(astroConfig: AstroConfig, pathname: string): URL {
const outRoot = getOutRoot(astroConfig);
// This is the root folder to write to.
switch(astroConfig.buildOptions.pageUrlFormat) {
case 'directory': return new URL('.' + appendForwardSlash(pathname), outRoot);
case 'file': return outRoot;
switch (astroConfig.buildOptions.pageUrlFormat) {
case 'directory':
return new URL('.' + appendForwardSlash(pathname), outRoot);
case 'file':
return outRoot;
}
}
function getOutFile(astroConfig: AstroConfig, outFolder: URL, pathname: string): URL {
switch(astroConfig.buildOptions.pageUrlFormat) {
case 'directory': return new URL('./index.html', outFolder);
case 'file': return new URL('.' + pathname + '.html', outFolder);
switch (astroConfig.buildOptions.pageUrlFormat) {
case 'directory':
return new URL('./index.html', outFolder);
case 'file':
return new URL('.' + pathname + '.html', outFolder);
}
}