-
Notifications
You must be signed in to change notification settings - Fork 8
vite-plugin-lib-inject-css not working on SSR #12
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
Comments
Of course sure, I'm trapped in my work and have no time to handle this for now, It would be fine if you have interest on it🎉 |
and I don't have much experience on ssr, i may need some days researching on it👀 |
vite-plugin-lib-inject-css (1.3.0) is published, you can have a try. |
It works as expected. Thank you 🙌 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We are currently migrating our Vue component library from Rollup to Vite. We gave a try to
vite-plugin-lib-inject-css
which is working like a charm for the client assets, but it doesn't work for the server assets (build with the--ssr
flag). It seems like it adds an import statement for the css file even though it doesn't exist (no CSS is generated on SSR which is expected).I created a reproduction: https://stackblitz.com/edit/vue3-vite-starter-f7mk9t?file=dist%2Fserver%2FMyButton.mjs
Of course, this breaks our SSR app that complains about the missing CSS files. One way to fix it would have been by using the SSR manifest generate with the
--ssrManifest
on client build, but it doesn't seem to work properly as the CSS file is sometimes missing. As you can see in my reproduction project, the entryHelloWorld
doesn't have anything listed in the manifest:So maybe
vite-plugin-lib-inject-css
could generate its own manifest and use it on SSR (e.g. by adding an optionssrManifestOutDir: '/absolute/path/to/dist/client'
to retrieve the manifest on server build).Can I suggest a solution by contributing a pull request? We are blocked by this issue so it's in our best interest to make it happen as soon as possible.
Thanks for the plugin by the way, it's a really nice solution to handle the CSS files 🙌
The text was updated successfully, but these errors were encountered: