Skip to content

Commit

Permalink
fix(netlify): externalise sharp when bundling edge middleware (#316)
Browse files Browse the repository at this point in the history
* fix(netlify): externalise sharp when bundling edge middleware

* Deps
  • Loading branch information
ascorbic authored Jul 1, 2024
1 parent 1f781f2 commit d81806a
Show file tree
Hide file tree
Showing 4 changed files with 203 additions and 19 deletions.
5 changes: 5 additions & 0 deletions .changeset/shy-ties-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/netlify': patch
---

Fixes a regression where edge middleware tried to bundle node builtins
2 changes: 1 addition & 1 deletion packages/netlify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@netlify/edge-functions": "^2.0.0",
"@netlify/edge-handler-types": "^0.34.1",
"@types/node": "^18.17.8",
"astro": "^4.10.1",
"astro": "^4.11.3",
"astro-scripts": "workspace:*",
"cheerio": "1.0.0-rc.12",
"execa": "^8.0.1",
Expand Down
1 change: 1 addition & 0 deletions packages/netlify/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ export default function netlifyIntegration(
format: 'esm',
bundle: true,
minify: false,
external: ['sharp'],
banner: {
// Import Deno polyfill for `process.env` at the top of the file
js: 'import process from "node:process";',
Expand Down
Loading

0 comments on commit d81806a

Please sign in to comment.