[ci] yarn format

This commit is contained in:
matthewp 2022-01-14 19:04:47 +00:00 committed by GitHub Actions
parent a7967530df
commit bd931a0a14
4 changed files with 7 additions and 9 deletions

View file

@ -59,10 +59,10 @@ export async function staticBuild(opts: StaticBuildOptions) {
const facadeIdToPageDataMap = new Map<string, PageBuildData>(); const facadeIdToPageDataMap = new Map<string, PageBuildData>();
// Collects polyfills and passes them as top-level inputs // Collects polyfills and passes them as top-level inputs
const polyfills = getRenderers(opts).flatMap(renderer => { const polyfills = getRenderers(opts).flatMap((renderer) => {
return (renderer.polyfills || []).concat(renderer.hydrationPolyfills || []); return (renderer.polyfills || []).concat(renderer.hydrationPolyfills || []);
}); });
for(const polyfill of polyfills) { for (const polyfill of polyfills) {
jsInput.add(polyfill); jsInput.add(polyfill);
} }

View file

@ -120,7 +120,9 @@ export async function generateHydrateScript(scriptOptions: HydrateScriptOptions,
let hydrationSource = ''; let hydrationSource = '';
if (renderer.hydrationPolyfills) { if (renderer.hydrationPolyfills) {
hydrationSource += `await Promise.all([${(await Promise.all(renderer.hydrationPolyfills.map(async (src: string) => `\n import("${await result.resolve(src)}")`))).join(', ')}]);\n`; hydrationSource += `await Promise.all([${(await Promise.all(renderer.hydrationPolyfills.map(async (src: string) => `\n import("${await result.resolve(src)}")`))).join(
', '
)}]);\n`;
} }
hydrationSource += renderer.source hydrationSource += renderer.source

View file

@ -12,11 +12,7 @@ describe('Static build - frameworks', () => {
before(async () => { before(async () => {
fixture = await loadFixture({ fixture = await loadFixture({
projectRoot: './fixtures/static-build-frameworks/', projectRoot: './fixtures/static-build-frameworks/',
renderers: [ renderers: ['@astrojs/renderer-preact', '@astrojs/renderer-react', '@astrojs/renderer-lit'],
'@astrojs/renderer-preact',
'@astrojs/renderer-react',
'@astrojs/renderer-lit'
],
buildOptions: { buildOptions: {
experimentalStaticBuild: true, experimentalStaticBuild: true,
}, },

View file

@ -1,4 +1,4 @@
import { installWindowOnGlobal } from "@lit-labs/ssr/lib/dom-shim.js"; import { installWindowOnGlobal } from '@lit-labs/ssr/lib/dom-shim.js';
installWindowOnGlobal(); installWindowOnGlobal();
window.global = window; window.global = window;