summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Matthew Phillips <matthew@skypack.dev> 2023-03-13 10:05:54 -0400
committerGravatar GitHub <noreply@github.com> 2023-03-13 10:05:54 -0400
commit4ddf3489384ed53f25df190a3478da44bd38600e (patch)
treec8d812118b3dc42c480d964dff9580d54389dd92
parent637f9bc728ea7d56fc82a862d761385f0dcd9528 (diff)
downloadastro-4ddf3489384ed53f25df190a3478da44bd38600e.tar.gz
astro-4ddf3489384ed53f25df190a3478da44bd38600e.tar.zst
astro-4ddf3489384ed53f25df190a3478da44bd38600e.zip
Remove false-positive warnings from Cloudflare's build (#6531)
-rw-r--r--.changeset/fair-emus-taste.md7
-rw-r--r--packages/integrations/cloudflare/src/index.ts3
2 files changed, 10 insertions, 0 deletions
diff --git a/.changeset/fair-emus-taste.md b/.changeset/fair-emus-taste.md
new file mode 100644
index 000000000..8afaf74ae
--- /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 0343e6e81..f0e252989 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