-
-
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
Css file or content will be lost in build watch #3742
Comments
Having this happen too. It's making watch practically unusable since you have to stop it and restart it to get your CSS back. |
It seems that the last working version is |
It looks like a very simple fix. The variable vite/packages/vite/src/node/plugins/css.ts Line 232 in 6eaec3a
buildStart .
Edit: Unfortunately it doesn't quite fix the issue. While experimenting in lib mode, it solved the issue when you directly edit the css, so that it reappears. And there is the problem, that the css only contains the styles from the last edited file, like explained in this issue. |
On 2.3.8 the issue still exists but with this fix it seems to be working again for me. |
Do you set |
No I am not using that option. |
It doesn't work for me, maybe I have overlooked something. Are you using |
I think we have two slightly different issues here. In my tests, I explicitly had a css entry file in lib mode. |
Ok, thank you, I know what went wrong. |
Hey all, I'm having the same issue on 2.3.8. Apart from CSS, the I saw @janispritzkau provided a fix, but no idea where to apply it? If anyone fixed the CSS missing issue, how did you solve it? |
…vitejs#3747) Co-authored-by: Shinigami <chrissi92@hotmail.de>
This issue has been locked since it has been closed for more than 14 days. If you have found a concrete bug or regression related to it, please open a new bug report with a reproduction against the latest Vite version. If you have any other comments you should join the chat at Vite Land or create a new discussion. |
Describe the bug
In the build --watch mode, the first build is ok. Then you change a file that is not css, after rebuilding,the css file in dist will be lost
Reproduction
App.vue
to trigger rebuild. Check dist folder again,css file is missing.If you change
a.css
,after rebuilding,the contents of css in dist will not include the contents ofb.css
.System Info
Output of
npx envinfo --system --npmPackages vite,@vitejs/plugin-vue --binaries --browsers
:Used package manager: yarn
Before submitting the issue, please make sure you do the following
The text was updated successfully, but these errors were encountered: