refactor: move to use optimizeDeps.force option

This commit is contained in:
bholmesdev 2022-06-22 19:41:43 -04:00
parent f803d80fa8
commit aab15e546a

View file

@ -59,6 +59,7 @@ export async function createVite(
clearScreen: false, // we want to control the output, not Vite clearScreen: false, // we want to control the output, not Vite
logLevel: 'warn', // log warnings and errors only logLevel: 'warn', // log warnings and errors only
optimizeDeps: { optimizeDeps: {
force: true,
entries: ['src/**/*'], // Try and scan a users project (wont catch everything), entries: ['src/**/*'], // Try and scan a users project (wont catch everything),
exclude: ['node-fetch'], exclude: ['node-fetch'],
}, },
@ -82,7 +83,6 @@ export async function createVite(
'import.meta.env.SITE': astroConfig.site ? `'${astroConfig.site}'` : 'undefined', 'import.meta.env.SITE': astroConfig.site ? `'${astroConfig.site}'` : 'undefined',
}, },
server: { server: {
force: true, // force dependency rebuild (TODO: enabled only while next is unstable; eventually only call in "production" mode?)
hmr: hmr:
process.env.NODE_ENV === 'test' || process.env.NODE_ENV === 'production' process.env.NODE_ENV === 'test' || process.env.NODE_ENV === 'production'
? false ? false