Last 12 weeks · 290 commits
5 of 6 standards met
Fixes #23178 Supersedes #23262 (same commit, reopened from a renamed branch). Summary Classify preload CSS dependencies from the parsed URL pathname instead of the full URL string Keep query/hash-suffixed CSS URLs returned by loading as stylesheets Add focused unit coverage for CSS preload URL detection Tests
Describe the bug The official Vite light and dark SVG logos can render inconsistently in WebKit when displayed at small icon sizes. Affected official assets: https://vite.dev/vite-light.svg https://vite.dev/vite-dark.svg These assets were introduced by #21339. In WebKit 27 on macOS 27, rendering either SVG at approximately 24px height can produce: A soft or blurry appearance Color bleeding around the lightning mark Incorrect dark edges or outlines Incorrect interpolation around transparent regions Chrome 153 renders the same files correctly. The screenshot below shows the worst-case WebKit rendering: the logo is completely incorrect. In ordinary cases, WebKit is usually not this severe, but it still appears noticeably blurrier than Chrome. WebKit issue screenshot from the downstream VitePress report: The official SVG files contain: 15 elements 15 effects 1 element viewBox: 0 0 87 15 These filter and mask effects appear to be rasterized differently by WebKit and Chromium. This also affects downstream consumers. VitePress documented the same issue and applied a raster fallback in https://github.com/vuejs/vitepress/pull/5466. Reproduction https://htmlpreview.github.io/?https://gist.githubusercontent.com/ChisakaKanako/07226c8cc5558efd1ea7c64cfb553236/raw/index.html Note: may occasionally fail to render the HTML. The issue can also be tested directly with the official and files at approximately height. Steps to reproduce 1. Open the reproduction URL in WebKit 27 on macOS 27. 2. Display the official Vite light/dark SVG logos at approximately 24px height. 3. Compare the rendering with Chrome 153 at the same size. 4. Observe the blur, color bleeding, and incorrect edges in WebKit. System Info Used Package Manager npm Logs Official Vite logo SVG structure: filters: 15 feGaussianBlur: 15 masks: 1 viewBox: 0 0 87 15 Downstream workaround and screenshots: https://github.com/vuejs/vitepress/pull/5466 Confirmed solution: Replace the SVG with pre-rendered image assets, such as PNG or WebP, for small icon usage. This avoids runtime SVG filter and mask processing and produces consistent WebKit/Chromium rendering. This is the solution currently used in VitePress PR #5466. Alternative SVG fix: Flatten or remove the Gaussian Blur filters and mask from the official SVG so it can render consistently without a raster fallback. Validations [x] Follow our Code of Conduct [x] Read the Contributing Guidelines. [x] Read the docs. [x] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate. [x] Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead. [x] Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server. [x] The provided reproduction is a minimal reproducible example of the bug.
Fixes #23178 Summary classify preload CSS dependencies from the parsed URL pathname instead of the full URL string keep query/hash-suffixed CSS URLs from renderBuiltUrl loading as stylesheets add focused unit coverage for CSS preload URL detection Tests pnpm --filter=./packages/vite run build-bundle .\\node_modules\\.bin\\vitest.CMD run packages/vite/src/node/__tests__/plugins/importAnalysisBuild.spec.ts .\\node_modules\\.bin\\oxfmt.CMD --check packages/vite/src/node/plugins/importAnalysisBuild.ts packages/vite/src/node/__tests__/plugins/importAnalysisBuild.spec.ts git diff --check
An excluded, missing optional peer required inside is converted into an eager ESM import. The missing-peer error then occurs before the dependency can select its fallback. This affects linkedom's optional require in cloudflare/vinext#3484. Resolve excluded CommonJS requires before creating the ESM facade. For missing optional peers, reuse the optimizer's existing CommonJS error stub so the error remains catchable at the call site. Keep the existing facade behavior for other excluded dependencies, including unresolved non-peer externals. Adding to the existing optimize-deps fixture's exclusions reproduces the failure without new dependencies. Validation: Existing optional-peer CJS browser test fails before the fix and passes afterward. Optimizer playground: 53 dev tests and 48 production tests passed. Optimizer unit tests: 8 passed; lint, formatting, package build, and type checks passed. Original vinext app-basic reproduction: red on unmodified Vite, green with this patch and vinext's existing discovery/exclusion configuration. Ten targeted browser tests passed, including all four next-intl cold-start/HMR cases. Related: #22970 handles excluded ESM import paths and explicitly leaves CommonJS facades unchanged; this addresses the missing optional peer case in that facade. AI-generated draft prepared by Codex; human review is pending.
This PR adds HMR patch loading even the update type is to ensure the case below: Nothing re-runs, but the patch is still loaded: a changed module that has not run yet, such as a CommonJS wrapper in the entry chunk, must find its new factory when it first runs. A failed load changes nothing on the page, so it does not reload.
Repository: vitejs/vite. Description: Next generation frontend tooling. It's fast! Stars: 83070, Forks: 8797. Primary language: TypeScript. Languages: TypeScript (83.4%), JavaScript (9.2%), HTML (4.4%), CSS (2.5%), Vue (0.2%). License: MIT. Homepage: http://vite.dev Topics: build-tool, dev-server, frontend, hmr, vite. Latest release: v8.3.1 (5d ago). Open PRs: 100, open issues: 684. Last activity: 7h ago. Community health: 87%. Top contributors: yyx990803, sapphi-red, patak-cat, bluwy, renovate[bot], antfu, btea, hi-ogawa, underfin, shulaoda and others.