From 57e603038fa51f5cf023c086705e2ced67434b38 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Tue, 27 Jun 2023 11:59:22 +0800 Subject: [PATCH] Handle esbuild 0.18 changes (#7479) --- .changeset/happy-stingrays-carry.md | 5 +++++ packages/astro/src/vite-plugin-astro/compile.ts | 2 ++ packages/astro/src/vite-plugin-jsx/index.ts | 2 ++ 3 files changed, 9 insertions(+) create mode 100644 .changeset/happy-stingrays-carry.md diff --git a/.changeset/happy-stingrays-carry.md b/.changeset/happy-stingrays-carry.md new file mode 100644 index 0000000000..f63778dcf2 --- /dev/null +++ b/.changeset/happy-stingrays-carry.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Handle esbuild 0.18 changes diff --git a/packages/astro/src/vite-plugin-astro/compile.ts b/packages/astro/src/vite-plugin-astro/compile.ts index 799e09e8e5..6bee4f672a 100644 --- a/packages/astro/src/vite-plugin-astro/compile.ts +++ b/packages/astro/src/vite-plugin-astro/compile.ts @@ -41,6 +41,8 @@ export async function cachedFullCompilation({ tsconfigRaw: { compilerOptions: { // Ensure client:only imports are treeshaken + // @ts-expect-error anticipate esbuild 0.18 feature + verbatimModuleSyntax: false, importsNotUsedAsValues: 'remove', }, }, diff --git a/packages/astro/src/vite-plugin-jsx/index.ts b/packages/astro/src/vite-plugin-jsx/index.ts index 91aa63909d..9364a4e0b7 100644 --- a/packages/astro/src/vite-plugin-jsx/index.ts +++ b/packages/astro/src/vite-plugin-jsx/index.ts @@ -160,6 +160,8 @@ export default function jsx({ settings, logging }: AstroPluginJSXOptions): Plugi tsconfigRaw: { compilerOptions: { // Ensure client:only imports are treeshaken + // @ts-expect-error anticipate esbuild 0.18 feature + verbatimModuleSyntax: false, importsNotUsedAsValues: 'remove', }, },