Skip to content

Commit

Permalink
Fix broken next release
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Oct 25, 2021
1 parent 7f95d70 commit 7e2d88a
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions packages/astro/src/core/create-vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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],
},
};

Expand Down

0 comments on commit 7e2d88a

Please sign in to comment.