From 190e03b5ced53dee44c401d48fd4b9efaad8c63a Mon Sep 17 00:00:00 2001 From: Matthew Phillips Date: Mon, 25 Oct 2021 12:55:26 -0400 Subject: [PATCH] Fix broken next release (#1652) --- packages/astro/src/core/create-vite.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/astro/src/core/create-vite.ts b/packages/astro/src/core/create-vite.ts index a59e363bd..dc0633f53 100644 --- a/packages/astro/src/core/create-vite.ts +++ b/packages/astro/src/core/create-vite.ts @@ -16,7 +16,18 @@ import { getPackageJSON, parseNpmName } from './util.js'; const require = createRequire(import.meta.url); // Some packages are just external, and that’s the way it goes. -const ALWAYS_EXTERNAL = new Set(['@sveltejs/vite-plugin-svelte', 'micromark-util-events-to-acorn', 'estree-util-value-to-estree', 'shorthash', 'unified']); +const ALWAYS_EXTERNAL = new Set([ + '@sveltejs/vite-plugin-svelte', + 'micromark-util-events-to-acorn', + 'estree-util-value-to-estree', + 'prismjs', + 'shorthash', + 'unified' +]); +const ALWAYS_NOEXTERNAL = new Set([ + // This is only because Vite's native ESM doesn't resolve "exports" correctly. + 'astro' +]); /* * Tailwind fixes @@ -70,7 +81,7 @@ export async function createVite(inlineConfig: ViteConfigWithSSR, { astroConfig, /** Note: SSR API is in beta (https://vitejs.dev/guide/ssr.html) */ ssr: { external: [...external, ...ALWAYS_EXTERNAL], - noExternal: [...noExternal], + noExternal: [...noExternal, ...ALWAYS_NOEXTERNAL], }, };