mirror of
https://github.com/withastro/astro.git
synced 2024-12-16 21:46:22 -05:00
[ci] format
This commit is contained in:
parent
4c1b769bcf
commit
85de47cd98
4 changed files with 4 additions and 6 deletions
|
@ -30,7 +30,7 @@ async function loadLocalImage(src: string, url: URL) {
|
||||||
if (!isAbsolute(filePath) || !filePath.startsWith(assetsDirPath)) {
|
if (!isAbsolute(filePath) || !filePath.startsWith(assetsDirPath)) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
} catch{
|
} catch {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,9 +179,7 @@ async function renderFrameworkComponent(
|
||||||
// Attempt: can we guess the renderer from the export extension?
|
// Attempt: can we guess the renderer from the export extension?
|
||||||
if (!renderer) {
|
if (!renderer) {
|
||||||
const extname = metadata.componentUrl?.split('.').pop();
|
const extname = metadata.componentUrl?.split('.').pop();
|
||||||
renderer = renderers.find(
|
renderer = renderers.find(({ name }) => name === `@astrojs/${extname}` || name === extname);
|
||||||
({ name }) => name === `@astrojs/${extname}` || name === extname
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ export default function loadFallbackPlugin({
|
||||||
try {
|
try {
|
||||||
// await is necessary for the catch
|
// await is necessary for the catch
|
||||||
return await fs.promises.readFile(cleanUrl(id), 'utf-8');
|
return await fs.promises.readFile(cleanUrl(id), 'utf-8');
|
||||||
} catch{
|
} catch {
|
||||||
try {
|
try {
|
||||||
return await fs.promises.readFile(id, 'utf-8');
|
return await fs.promises.readFile(id, 'utf-8');
|
||||||
} catch {
|
} catch {
|
||||||
|
|
Loading…
Reference in a new issue