From 2f090713c9133eebdf637747adb4ec7ce2fba5db Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Mon, 13 Mar 2023 09:03:54 -0400 Subject: [PATCH] Remove false-positive warnings from Cloudflare's build --- .changeset/fair-emus-taste.md | 7 +++++++ packages/integrations/cloudflare/src/index.ts | 3 +++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/fair-emus-taste.md diff --git a/.changeset/fair-emus-taste.md b/.changeset/fair-emus-taste.md new file mode 100644 index 000000000000..8afaf74aefdb --- /dev/null +++ b/.changeset/fair-emus-taste.md @@ -0,0 +1,7 @@ +--- +'@astrojs/cloudflare': patch +--- + +Remove false-positive warnings from Cloudflare's build. + +Cloudflare includes warnings when it bundles the already-built output from astro.build. Those warnings are mostly due to `"sideEffects": false` packages that are included in the Vite built output because they are marked as external. Rollup will remove unused imports from these packages but will not remove the actual import, causing the false-positive warning. diff --git a/packages/integrations/cloudflare/src/index.ts b/packages/integrations/cloudflare/src/index.ts index 0343e6e81874..f0e252989b72 100644 --- a/packages/integrations/cloudflare/src/index.ts +++ b/packages/integrations/cloudflare/src/index.ts @@ -107,6 +107,9 @@ export default function createIntegration(args?: Options): AstroIntegration { banner: { js: SHIM, }, + logOverride: { + 'ignored-bare-import': 'silent' + }, }); // Rename to worker.js