vue-meteor icon indicating copy to clipboard operation
vue-meteor copied to clipboard

Adding styles from <style> to global Meteor CSS file

Open mitar opened this issue 8 years ago • 4 comments

It seems that style from .vue files inside <style> tags are added inline inside <style> to DOM. I would prefer that they are added to the global Meteor CSS file so that they are simply loaded once and this is it. If I want scoped CSS to the component I will use that, but I do not see much use of dynamically loaded CSS.

mitar avatar Jul 08 '17 19:07 mitar

This is sort of a regression made to support code-splitting. If you know a way to add style to the standard style workflow while still marking the js as lazy, let us know! :smile:

[Edit] Or maybe there is a way to detect if the module will be included in the initial bundle or not.

Akryum avatar Jul 15 '17 10:07 Akryum

cc @benjamn, maybe he can help?

mitar avatar Jul 15 '17 23:07 mitar

Any progress on this?

mitar avatar Oct 31 '17 06:10 mitar

I opened: https://github.com/meteor/meteor-feature-requests/issues/218

It seems that even CSS included from standard modules get added to <style>.

So in my case, I understand that for lazy loading there is not much you can do. But I observe this even for vue files outside of imports, which are bundled. So why is CSS for those files not bundled as well? That should be pretty easy to detect, no? So no need for static analysis, but simply, if it is outside imports, bundle CSS.

mitar avatar Nov 13 '17 19:11 mitar