Force Vite to rebuild dependencies (#1670)

This commit is contained in:
Drew Powers 2021-10-26 22:54:41 -06:00 committed by GitHub
parent 5477dc19c2
commit 7f74388896
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -50,14 +50,14 @@ export async function createVite(inlineConfig: ViteConfigWithSSR, { astroConfig,
publicDir: fileURLToPath(astroConfig.public), publicDir: fileURLToPath(astroConfig.public),
root: fileURLToPath(astroConfig.projectRoot), root: fileURLToPath(astroConfig.projectRoot),
server: { server: {
/** disable HMR for test */ force: true, // force dependency rebuild (TODO: enabled only while next is unstable; eventually only call in "production" mode?)
hmr: process.env.NODE_ENV === 'test' || process.env.NODE_ENV === 'production' ? false : undefined, hmr: process.env.NODE_ENV === 'test' || process.env.NODE_ENV === 'production' ? false : undefined, // disable HMR for test
/** handle Vite URLs */ // handle Vite URLs
proxy: { proxy: {
// add proxies here // add proxies here
}, },
}, },
/** Note: SSR API is in beta (https://vitejs.dev/guide/ssr.html) */ // Note: SSR API is in beta (https://vitejs.dev/guide/ssr.html)
ssr: { ssr: {
external: [...ALWAYS_EXTERNAL], external: [...ALWAYS_EXTERNAL],
noExternal: [...ALWAYS_NOEXTERNAL], noExternal: [...ALWAYS_NOEXTERNAL],