diff --git a/astro.config.mjs b/astro.config.mjs index aea45ff..a9a66ad 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -9,13 +9,6 @@ export default defineConfig({ integrations: [react(), tailwind({ applyBaseStyles: false })], - build: { - rollupOptions: { - external: [ - "sharp" - ] - } - }, output: "server", adapter: vercel() }); diff --git a/bun.lockb b/bun.lockb index 0179950..b363b79 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index e2ea208..122840e 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,6 @@ "nanoid": "^5.0.4", "react": "^18.2.0", "react-dom": "^18.2.0", - "sharp": "^0.33.2", "tailwind-merge": "^2.2.0", "tailwindcss": "^3.4.1", "tailwindcss-animate": "^1.0.7", @@ -43,8 +42,5 @@ "devDependencies": { "@types/bun": "^1.0.5", "@types/google.maps": "^3.54.10" - }, - "trustedDependencies": [ - "sharp" - ] + } } diff --git a/src/pages/api/content/index.ts b/src/pages/api/content/index.ts index f3c2328..39cedad 100644 --- a/src/pages/api/content/index.ts +++ b/src/pages/api/content/index.ts @@ -1,6 +1,4 @@ import { createClient } from "@supabase/supabase-js" -import sharp from "sharp" - import type { APIRoute } from "astro" import { createKysely } from "@vercel/postgres-kysely" import { customAlphabet } from "nanoid" @@ -40,11 +38,8 @@ export const POST: APIRoute = async ({ request }) => { const randomImageId = nanoid() const imageName = `${image.name.replace(/\.[^/.]+$/, "")}${randomImageId}.jpg` - const imagebuf = await image.arrayBuffer() - const compressed = await sharp(imagebuf).toFormat("jpg", { quality: 75 }).toBuffer() - - const { data, error } = await supabase.storage.from("images").upload(`public/${imageName}`, compressed, { + const { error } = await supabase.storage.from("images").upload(`public/${imageName}`, image, { cacheControl: "3600", upsert: false })