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: set perEnvironmentStartEndDuringDev: true for runnerImport to fix css import #19598

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hi-ogawa
Copy link
Collaborator

@hi-ogawa hi-ogawa commented Mar 7, 2025

Description

Related

Currently buildStart of internal css plugin is not called and that's causing a cryptic error on css import as reported #19577.

@hi-ogawa hi-ogawa changed the title fix: set perEnvironmentStartEndDuringDev when runnerImport to fix css import fix: set perEnvironmentStartEndDuringDev: true when runnerImport to fix css import Mar 7, 2025
@hi-ogawa hi-ogawa changed the title fix: set perEnvironmentStartEndDuringDev: true when runnerImport to fix css import fix: set perEnvironmentStartEndDuringDev: true for runnerImport to fix css import Mar 7, 2025
@hi-ogawa hi-ogawa marked this pull request as ready for review March 7, 2025 00:23
Comment on lines +42 to +44
server: {
perEnvironmentStartEndDuringDev: true,
},
Copy link
Member

Choose a reason for hiding this comment

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

this may bring issues in the future, we can add perEnvironmentStartEndDuringDev: true to the CSS plugin, no?

Copy link
Collaborator Author

@hi-ogawa hi-ogawa Mar 8, 2025

Choose a reason for hiding this comment

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

I wasn't sure about adding perEnvironmentStartEndDuringDev to css plugins since currently css plugins tracks states based on top level ResolvedConfig, so calling buildStart multiple times can end up breaking the state.

Other plugins such as vite:manifest and vite:assets already use perEnvironmentStartEndDuringDev, but those plugins are written based on "per environment state", but that's not the case for css plugins.

I think there is something I misunderstood about buildStart in general, and for example, my fix on vite-node vitest-dev/vitest#7480 isn't probably good, so I have to revisit this one too. Probably I'll create an issue first.


I made two issues #19607, #19606

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.

2 participants