@astrojs/cloudflare 7.6.1 → 7.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +11 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { createRedirectsFromAstroRoutes } from '@astrojs/underscore-redirects';
2
+ import { passthroughImageService } from 'astro/config';
2
3
  import { AstroError } from 'astro/errors';
3
4
  import esbuild from 'esbuild';
4
5
  import { Miniflare } from 'miniflare';
@@ -47,7 +48,13 @@ export default function createIntegration(args) {
47
48
  return {
48
49
  name: '@astrojs/cloudflare',
49
50
  hooks: {
50
- 'astro:config:setup': ({ config, updateConfig }) => {
51
+ 'astro:config:setup': ({ config, updateConfig, logger }) => {
52
+ let imageConfigOverwrite = false;
53
+ if (config.image.service.entrypoint === 'astro/assets/services/sharp' ||
54
+ config.image.service.entrypoint === 'astro/assets/services/squoosh') {
55
+ logger.warn(`The current configuration does not support image optimization. To allow your project to build with the original, unoptimized images, the image service has been automatically switched to the 'noop' option. See https://docs.astro.build/en/reference/configuration-reference/#imageservice`);
56
+ imageConfigOverwrite = true;
57
+ }
51
58
  updateConfig({
52
59
  build: {
53
60
  client: new URL(`.${config.base}`, config.outDir),
@@ -64,6 +71,9 @@ export default function createIntegration(args) {
64
71
  }),
65
72
  ],
66
73
  },
74
+ image: imageConfigOverwrite
75
+ ? { ...config.image, service: passthroughImageService() }
76
+ : config.image,
67
77
  });
68
78
  },
69
79
  'astro:config:done': ({ setAdapter, config, logger }) => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "//comment": "test changeset-bot",
3
3
  "name": "@astrojs/cloudflare",
4
4
  "description": "Deploy your site to Cloudflare Workers/Pages",
5
- "version": "7.6.1",
5
+ "version": "7.6.3",
6
6
  "type": "module",
7
7
  "types": "./dist/index.d.ts",
8
8
  "author": "withastro",