Skip to content

Conversation

@bluwy
Copy link
Member

@bluwy bluwy commented Oct 10, 2025

Description

Alternative to #19182

Use tryNodeResolve instead of require.resolve() for resolving CSS preprocessors and terser. The tryNodeResolve logic and options are extracted from the esbuild config loader resolve.

TODO: Manual testing

@bluwy bluwy added the p3-minor-bug An edge case that only affects very specific usage (priority) label Oct 10, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Oct 16, 2025

Open in StackBlitz

npm i https://pkg.pr.new/vite@20918

commit: 2dfe88f

@sapphi-red
Copy link
Member

I've tested the repo linked in #19182 and it worked 👍

I tested four combinations locally based on https://github.com/hi-ogawa/reproductions/tree/main/vite-19182-sass-tsx

  • node + sass-embedded
  • node + sass
  • tsx + sass-embedded (this was failing before)
  • tsx + sass

#19182 (comment)

@bluwy bluwy added this to the 7.2 milestone Oct 16, 2025
@sapphi-red sapphi-red merged commit 1460824 into main Oct 22, 2025
27 of 28 checks passed
@sapphi-red sapphi-red deleted the css-terser-esm branch October 22, 2025 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p3-minor-bug An edge case that only affects very specific usage (priority) trigger: preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants