diff --git a/.changeset/happy-stingrays-carry.md b/.changeset/happy-stingrays-carry.md new file mode 100644 index 000000000000..f63778dcf23b --- /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 799e09e8e565..6bee4f672ae0 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 91aa63909d2d..9364a4e0b77a 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', }, },