diff --git a/packages/astro/src/core/build/static-build.ts b/packages/astro/src/core/build/static-build.ts index 75aa4e122..ee68e486c 100644 --- a/packages/astro/src/core/build/static-build.ts +++ b/packages/astro/src/core/build/static-build.ts @@ -59,10 +59,10 @@ export async function staticBuild(opts: StaticBuildOptions) { const facadeIdToPageDataMap = new Map(); // 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 || []); }); - for(const polyfill of polyfills) { + for (const polyfill of polyfills) { jsInput.add(polyfill); } diff --git a/packages/astro/src/runtime/server/hydration.ts b/packages/astro/src/runtime/server/hydration.ts index d574d400c..cd786999d 100644 --- a/packages/astro/src/runtime/server/hydration.ts +++ b/packages/astro/src/runtime/server/hydration.ts @@ -120,7 +120,9 @@ export async function generateHydrateScript(scriptOptions: HydrateScriptOptions, let hydrationSource = ''; 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 diff --git a/packages/astro/test/static-build-frameworks.test.js b/packages/astro/test/static-build-frameworks.test.js index 0f126f671..a8561e721 100644 --- a/packages/astro/test/static-build-frameworks.test.js +++ b/packages/astro/test/static-build-frameworks.test.js @@ -12,11 +12,7 @@ describe('Static build - frameworks', () => { before(async () => { fixture = await loadFixture({ projectRoot: './fixtures/static-build-frameworks/', - renderers: [ - '@astrojs/renderer-preact', - '@astrojs/renderer-react', - '@astrojs/renderer-lit' - ], + renderers: ['@astrojs/renderer-preact', '@astrojs/renderer-react', '@astrojs/renderer-lit'], buildOptions: { experimentalStaticBuild: true, }, diff --git a/packages/renderers/renderer-lit/server-shim.js b/packages/renderers/renderer-lit/server-shim.js index 7cb735a52..054679592 100644 --- a/packages/renderers/renderer-lit/server-shim.js +++ b/packages/renderers/renderer-lit/server-shim.js @@ -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(); window.global = window;