-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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(css): file or contents missing error in build watch (#3742) #3747
Conversation
Could you add tests that will fail when your fix is not applied? |
Ok, you can read my repo in #3742 about |
This is repo https://github.com/javastation/vite/tree/bug
|
What I meant was a test in our test-suite, so e.g. a unit test or integration test in one of the playgrounds. This way it will always checked when someone create a PR. |
Ok, I got it wrong before. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great first PR to the project @javastation. Thanks a lot for also taking the time to improve the test suite.
Not for this PR, but if you would like to do so, it would be great if you could do a review of other plugin caches and how they interact with build watch. I sent a few PRs trying to fix build watch a few versions ago ( #3537, #3516, #3530, #3512 ), but I didn't take into account the internal rollup cache that prevents unmodified files to go through the hooks pipeline in each build. There is also another cache in the build-html plugin (see #3535) that I couldn't modify and it may be related to the issue you found. Thanks again, I hope we keep seeing you around in the project 👍🏼
I also noticed the |
…vitejs#3747) Co-authored-by: Shinigami <chrissi92@hotmail.de>
Description
Fix #3742,
styles
will be incomplete,becausestyles
is initialized inbuildStart
.vite/packages/vite/src/node/plugins/css.ts
Line 290 in 5979d0e
In
asset.ts
,assetHashToFilenameMap
initialization inbuildStart
causesgetAssetFilename
called incss.ts
to returnundefined
.vite/packages/vite/src/node/plugins/css.ts
Line 314 in 5979d0e
I add another variable
emittedHashesSet
to determine whether to emit a file.Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123
).