diff --git a/packages/integrations/netlify/src/integration-edge-functions.ts b/packages/integrations/netlify/src/integration-edge-functions.ts index 3ef39eecb..a4bd66e51 100644 --- a/packages/integrations/netlify/src/integration-edge-functions.ts +++ b/packages/integrations/netlify/src/integration-edge-functions.ts @@ -1,9 +1,9 @@ -import type { AstroAdapter, AstroIntegration, AstroConfig, RouteData, BuildConfig } from 'astro'; -import { createRedirects } from './shared.js'; +import type { AstroAdapter, AstroConfig, AstroIntegration, BuildConfig, RouteData } from 'astro'; import esbuild from 'esbuild'; import * as fs from 'fs'; -import { fileURLToPath } from 'url'; import * as npath from 'path'; +import { fileURLToPath } from 'url'; +import { createRedirects } from './shared.js'; export function getAdapter(): AstroAdapter { return { @@ -76,12 +76,13 @@ async function bundleServerEntry(buildConfig: BuildConfig, vite: any) { allowOverwrite: true, format: 'esm', bundle: true, - external: [ "@astrojs/markdown-remark"] + external: ['@astrojs/markdown-remark'], }); // Remove chunks, if they exist. Since we have bundled via esbuild these chunks are trash. try { - const chunkFileNames = vite?.build?.rollupOptions?.output?.chunkFileNames ?? 'chunks/chunk.[hash].mjs'; + const chunkFileNames = + vite?.build?.rollupOptions?.output?.chunkFileNames ?? 'chunks/chunk.[hash].mjs'; const chunkPath = npath.dirname(chunkFileNames); const chunksDirUrl = new URL(chunkPath + '/', buildConfig.server); await fs.promises.rm(chunksDirUrl, { recursive: true, force: true }); diff --git a/packages/integrations/netlify/test/edge-functions/dynamic-import.test.js b/packages/integrations/netlify/test/edge-functions/dynamic-import.test.js index d4c61fb1f..9688a8753 100644 --- a/packages/integrations/netlify/test/edge-functions/dynamic-import.test.js +++ b/packages/integrations/netlify/test/edge-functions/dynamic-import.test.js @@ -18,7 +18,7 @@ Deno.test({ assert(html, 'got some html'); const doc = new DOMParser().parseFromString(html, `text/html`); const div = doc.querySelector('#thing'); - assert(div, 'div exists') + assert(div, 'div exists'); } finally { await close(); await stop(); diff --git a/packages/integrations/netlify/test/edge-functions/test-utils.ts b/packages/integrations/netlify/test/edge-functions/test-utils.ts index 72b411d38..7c2400d93 100644 --- a/packages/integrations/netlify/test/edge-functions/test-utils.ts +++ b/packages/integrations/netlify/test/edge-functions/test-utils.ts @@ -13,17 +13,17 @@ export async function runBuild(fixturePath: string) { } export async function runApp(entryPath: string) { - const entryUrl = new URL(entryPath, dir) + const entryUrl = new URL(entryPath, dir); let proc = Deno.run({ cmd: ['deno', 'run', '--allow-env', '--allow-net', fromFileUrl(entryUrl)], //cwd: fromFileUrl(entryUrl), - stderr: 'piped' + stderr: 'piped', }); const stderr = readableStreamFromReader(proc.stderr); const dec = new TextDecoder(); - for await(let bytes of stderr) { + for await (let bytes of stderr) { let msg = dec.decode(bytes); - if(msg.includes(`Server running`)) { + if (msg.includes(`Server running`)) { break; } }