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(vite): don't warm up css deps and normalise urls correctly #23975

Merged
merged 6 commits into from Oct 30, 2023

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Oct 27, 2023

πŸ”— Linked issue

resolves #20533
resolves #14898

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

It seems we are over-warming up vite, and in particular warming up lots of Sass files has a significant performance cost in some projects, which is not actually needed.

This PR ensures we align our warmup logic with the upcoming warmup option in Vite 5 (vitejs/vite#14291).

This PR skips warming up CSS dependencies as these are duplicate (ie. they are already included in the output of the first CSS dep). It also applies same logic for normalising URLs as Vite does itself, e.g.:

https://github.com/vitejs/vite/blob/e4c801c552edc4a60659720b89777e29eb93db6b/packages/vite/src/node/plugins/importAnalysis.ts#L604

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@stackblitz
Copy link

stackblitz bot commented Oct 27, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@danielroe danielroe changed the title perf(vite): don't explicitly warmup module dependencies fix(vite): skip warming up css deps and normalise urls correctly Oct 27, 2023
@danielroe danielroe changed the title fix(vite): skip warming up css deps and normalise urls correctly fix(vite): don't warm up css deps and normalise urls correctly Oct 30, 2023
@danielroe danielroe merged commit 4f017a5 into main Oct 30, 2023
33 checks passed
@danielroe danielroe deleted the perf/warmup branch October 30, 2023 21:02
@github-actions github-actions bot mentioned this pull request Oct 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Significant Sass build time difference between Nuxt and Vite vite-node does not use warmup cache
1 participant