[ci] yarn format
This commit is contained in:
parent
a7967530df
commit
bd931a0a14
4 changed files with 7 additions and 9 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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,
|
||||||
},
|
},
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue