-
-
Notifications
You must be signed in to change notification settings - Fork 590
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
Styles are inserted into the head instead of css bundle #24
Comments
Hey @piehei It is the default behaviour of Did you do benchmarking? What is the performance fall? On the matter, I can prob. add a separate building task using ExtractTextPlugin. E.g. you will have to do something like
Will it help? Thanks for kind words 👍 😄 |
It causes the browser to recalculate styles if I'm not mistaken. That could cause the page to flash white and/or some jank. The point being:
My own Vue components don't insert any css, everything is included in the single css bundle webpack generates. I don't use any other 3rd party components so cannot compare. One thing to note: when using webpack dev server, all the styles are inserted into the DOM no matter what component is in question. But this should only happen in dev mode, not production if I'm not completely mistaken. There shouldn't be any reason to add the css dynamically when the app is running (if we leave out all code-splitting sorcery). Any thoughts? Am I missing something? :-) |
Yeah, you have a point. I am still not sure if it is a problem though, especially for the component that should be invisible by default and if you already use some framework like Vue or React. Recalculating styles once is not a biggie in comparison to other operations your browser has to do to run 200kb+ of javascript :D I have been using it in production for a while and never faced any problems (please consider that my home internet is 10mb/s shared between 3 ppl 😃 😢 😢 ) |
I've looked through a dozen of component to figure out how to pack it for distribution (i'm a webpack noob) and all of them supplied just Do you think the solution from my first answer will be useful for you? Hope it will help you to bundle the css styles all together, but I do not want to break the plugin for other people who already have it in prod 😅 |
Hi
I'm using the plugin as suggested but for some reason the styles are inserted straight into the head inside style tags when my app starts. I'm using Webpack for bundling my app. All other CSS gets correctly into the css bundle but vue-js-modal css only appears to be added dynamically when the app runs.
I think this is a bug since the browser needs to do more work this way and the performance suffers.
Could something be done so that the styles would be included in the css bundle and no runtime styles manipulation would be necessary?
Thanks for the awesome plugin!
BR
Pietari
The text was updated successfully, but these errors were encountered: