Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the next release #1652

Merged
merged 1 commit into from
Oct 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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