[ci] yarn format
This commit is contained in:
parent
007c22065d
commit
5814f2faca
5 changed files with 8 additions and 7 deletions
|
@ -2,4 +2,4 @@
|
|||
'astro': patch
|
||||
---
|
||||
|
||||
Remove custom Astro.fetchContent() glob implementation, use `import.meta.globEager` internally instead.
|
||||
Remove custom Astro.fetchContent() glob implementation, use `import.meta.globEager` internally instead.
|
||||
|
|
|
@ -53,7 +53,7 @@ For best results, you should only have one `<style>` tag per-Astro component. Th
|
|||
<html>
|
||||
<head>
|
||||
<style>
|
||||
...
|
||||
...;
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -352,7 +352,7 @@ function compileModule(ast: Ast, module: Script, state: CodegenState, compileOpt
|
|||
}
|
||||
|
||||
// Convert Astro.fetchContent() to use import.meta.glob
|
||||
if ((/Astro\s*\.\s*fetchContent/).test(module.content)) {
|
||||
if (/Astro\s*\.\s*fetchContent/.test(module.content)) {
|
||||
state.importStatements.add(`import {fetchContent} from 'astro/dist/internal/fetch-content.js';\n`);
|
||||
traverse(parseResult, {
|
||||
enter({ node }) {
|
||||
|
@ -377,7 +377,7 @@ function compileModule(ast: Ast, module: Script, state: CodegenState, compileOpt
|
|||
property: { type: 'Identifier', name: 'globEager' },
|
||||
computed: false,
|
||||
},
|
||||
arguments: node.arguments
|
||||
arguments: node.arguments,
|
||||
},
|
||||
] as any;
|
||||
},
|
||||
|
|
|
@ -114,7 +114,7 @@ export async function compileComponent(source: string, { compileOptions, filenam
|
|||
import fetch from 'node-fetch';
|
||||
${result.imports.join('\n')}
|
||||
|
||||
${/* Global Astro Namespace (shadowed & extended by the scoped namespace inside of __render()) */''}
|
||||
${/* Global Astro Namespace (shadowed & extended by the scoped namespace inside of __render()) */ ''}
|
||||
const __TopLevelAstro = {
|
||||
site: new URL('/', ${JSON.stringify(site)}),
|
||||
fetchContent: (globResult) => fetchContent(globResult, import.meta.url),
|
||||
|
|
|
@ -19,5 +19,6 @@ export function fetchContent(importMetaGlobResult: Record<string, any>, url: str
|
|||
...mod.__content,
|
||||
url: urlSpec.replace(/^.*\/pages\//, '/').replace(/\.md$/, ''),
|
||||
};
|
||||
}).filter(Boolean);
|
||||
}
|
||||
})
|
||||
.filter(Boolean);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue