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: more stable hash calculation for depsOptimize #15337

Merged
merged 2 commits into from
Dec 13, 2023
Merged
Changes from 1 commit
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
5 changes: 2 additions & 3 deletions packages/vite/src/node/optimizer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1216,8 +1216,8 @@ export function getDepHash(config: ResolvedConfig, ssr: boolean): string {
assetsInclude: config.assetsInclude,
plugins: config.plugins.map((p) => p.name),
optimizeDeps: {
include: optimizeDeps?.include,
exclude: optimizeDeps?.exclude,
include: Array.from(new Set(optimizeDeps?.include)).sort(),
exclude: Array.from(new Set(optimizeDeps?.exclude)).sort(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one! Sounds good to me. We should still keep it as undefined if the option wasnt set though to avoid changing the hash for all the projects without explicit include/exclude and trigger a cold start for them

esbuildOptions: {
...optimizeDeps?.esbuildOptions,
plugins: optimizeDeps?.esbuildOptions?.plugins?.map((p) => p.name),
Expand Down Expand Up @@ -1289,7 +1289,6 @@ export async function optimizedDepNeedsInterop(
return depInfo?.needsInterop
}

const MAX_TEMP_DIR_AGE_MS = 24 * 60 * 60 * 1000
export async function cleanupDepsCacheStaleDirs(
config: ResolvedConfig,
): Promise<void> {
Expand Down
Loading