Skip to content

Commit affa6fd

Browse files
committed
environments: get images to build in fixture
1 parent f6b0a73 commit affa6fd

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

packages/integrations/cloudflare/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,8 @@ export default function createIntegration(args?: Options): AstroIntegration {
379379
vite.build.rollupOptions.output.banner ||=
380380
'globalThis.process ??= {}; globalThis.process.env ??= {};';
381381

382+
vite.build.rollupOptions.external = ['sharp'];
383+
382384
// Cloudflare env is only available per request. This isn't feasible for code that access env vars
383385
// in a global way, so we shim their access as `process.env.*`. This is not the recommended way for users to access environment variables. But we'll add this for compatibility for chosen variables. Mainly to support `@astrojs/db`
384386
vite.define = {

packages/integrations/cloudflare/test/fixtures/vite-plugin/package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
6-
"dev": "astro dev"
6+
"dev": "astro dev",
7+
"build": "astro build"
78
},
89
"dependencies": {
910
"@astrojs/cloudflare": "workspace:*",
1011
"@astrojs/mdx": "^4.3.5",
1112
"@astrojs/react": "workspace:*",
13+
"@types/react": "^18.3.24",
14+
"@types/react-dom": "^18.3.7",
1215
"astro": "workspace:*",
13-
"@types/react": "^18.3.24",
14-
"@types/react-dom": "^18.3.7",
15-
"react": "^18.3.1",
16-
"react-dom": "^18.3.1"
16+
"react": "^18.3.1",
17+
"react-dom": "^18.3.1",
18+
"sharp": "^0.34.3"
1719
}
1820
}

pnpm-lock.yaml

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)