aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2024-08-15 15:01:41 -0400
committerGravatar GitHub <noreply@github.com> 2024-08-15 15:01:41 -0400
commit9beddd1e30a2d1649de015e7ab3d944fa29a4a71 (patch)
tree13b57bcb99c2c7f7afa45da7014a8e1cf6265cf3
parentf6f0005ac00237c6d9dc9bb72da81485d9008f99 (diff)
downloadastro-9beddd1e30a2d1649de015e7ab3d944fa29a4a71.tar.gz
astro-9beddd1e30a2d1649de015e7ab3d944fa29a4a71.tar.zst
astro-9beddd1e30a2d1649de015e7ab3d944fa29a4a71.zip
Apply polyfills right away (#350)
-rw-r--r--packages/integrations/netlify/src/index.ts4
-rw-r--r--packages/integrations/netlify/src/ssr-function.ts4
2 files changed, 4 insertions, 4 deletions
diff --git a/packages/integrations/netlify/src/index.ts b/packages/integrations/netlify/src/index.ts
index 0a4c4cfaf..ab4671115 100644
--- a/packages/integrations/netlify/src/index.ts
+++ b/packages/integrations/netlify/src/index.ts
@@ -1,5 +1,5 @@
import { randomUUID } from 'node:crypto';
-import { appendFile, mkdir, readFile, rm, writeFile } from 'node:fs/promises';
+import { appendFile, mkdir, readFile, writeFile } from 'node:fs/promises';
import type { IncomingMessage } from 'node:http';
import { fileURLToPath } from 'node:url';
import { emptyDir } from '@astrojs/internal-helpers/fs';
@@ -495,7 +495,7 @@ export default function netlifyIntegration(
// local dev
'astro:server:setup': async ({ server }) => {
- server.middlewares.use((req, res, next) => {
+ server.middlewares.use((req, _res, next) => {
const locals = Symbol.for('astro.locals');
Reflect.set(req, locals, {
...Reflect.get(req, locals),
diff --git a/packages/integrations/netlify/src/ssr-function.ts b/packages/integrations/netlify/src/ssr-function.ts
index dba0dbead..22925ddaa 100644
--- a/packages/integrations/netlify/src/ssr-function.ts
+++ b/packages/integrations/netlify/src/ssr-function.ts
@@ -3,14 +3,14 @@ import type { SSRManifest } from 'astro';
import { App } from 'astro/app';
import { applyPolyfills } from 'astro/app/node';
+applyPolyfills();
+
// Won't throw if the virtual module is not available because it's not supported in
// the users's astro version or if astro:env is not enabled in the project
await import('astro/env/setup')
.then((mod) => mod.setGetEnv((key) => process.env[key]))
.catch(() => {});
-applyPolyfills();
-
export interface Args {
middlewareSecret: string;
}