Skip to content

fix: map css minify warnings to source files#22645

Open
pupuking723 wants to merge 1 commit into
vitejs:mainfrom
pupuking723:fix/css-minify-warning-sources
Open

fix: map css minify warnings to source files#22645
pupuking723 wants to merge 1 commit into
vitejs:mainfrom
pupuking723:fix/css-minify-warning-sources

Conversation

@pupuking723

Copy link
Copy Markdown

Description

Maps esbuild CSS minification warnings back to the CSS source file that contributed the warning location. This makes warnings from merged CSS bundles point at files such as test.css instead of only the generated bundle name like style.css.

Fixes #15915.

Additional context

The CSS plugin now tracks the line ranges contributed by each CSS module while building CSS chunks. When esbuild reports a warning against the bundled CSS, Vite remaps the warning location before formatting the message.

Validation

  • npx pnpm@10.34.1 --filter vite build
  • npx pnpm@10.34.1 --filter vite typecheck
  • npx pnpm@10.34.1 run typecheck
  • npx pnpm@10.34.1 run test-build playground/minify
  • pre-commit oxfmt and eslint passed for the changed files

@pupuking723 pupuking723 force-pushed the fix/css-minify-warning-sources branch from 3c28f2e to 9448ae9 Compare June 8, 2026 12:36
@pupuking723 pupuking723 marked this pull request as ready for review June 8, 2026 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSS minification warnings don't contain file names, making them difficult to track down

1 participant