[Feature request] Support ?lazy
for vite and webpack or at least ?inline
for webpack
#1351
Labels
?lazy
for vite and webpack or at least ?inline
for webpack
#1351
Clear and concise description of the problem
Currently all styles are extracted to a single file then loaded at page entry. However, some components maybe async, e.g.:
In this case,
lib/style.css
should better be loaded with the component, i.e., the time entering a page that has that component.With a lot of async components with styles, the main CSS can be at large size, while a large part of style declarations unused in page.
Suggested solution
Add support for
?lazy
to mark a css, and left it without being extracted, this could be difficult as we must develop vite plugin and webpack loader.Alternative
Support
?inline
modifier for webpack lite vite does, so we can import style content and load them with functions likeuseStyleTag
from@vueuse
, e.g.:Additional context
No response
The text was updated successfully, but these errors were encountered: