Vuetify-module: How to preload vuetify theme

Created on 5 Sep 2019  路  20Comments  路  Source: nuxt-community/vuetify-module

Is your feature request related to a problem? Please describe.
I don't know how to preload vuetify theme css.
I tried shouldPreload method but it doesn't seems working

// nuxt.config.ts
render: {
    bundleRenderer: {
      shouldPreload: (file, type) => {
        return ['script', 'style', 'font'].includes(type)
      },
    },
  },
// vuetify option
theme: {
    options: {
      customProperties: true,
      minifyTheme: (css) => {
        return css.replace(/[\r\n|\r|\n]/g, '')
      },
    },
    dark: true,
    themes: {
      light: {
        primary: colors.grey.darken4,
        secondary: colors.amber.darken3,
        accent: colors.lightBlue.darken1,
        info: colors.blue.darken4,
        warning: colors.orange.darken4,
        error: colors.red.darken4,
        success: colors.green.darken3,
      },
      dark: {
        primary: colors.blue.darken2,
        secondary: colors.amber.darken3,
        accent: colors.grey.darken3,
        info: colors.teal.lighten1,
        warning: colors.amber.base,
        error: colors.deepOrange.accent4,
        success: colors.green.accent3,
      },
    },
  },
<link href="/_nuxt/28525bf520ad9181cd06.css" rel="stylesheet">



md5-c69158f21c59bcec99824be885a12bd5



<link rel="preload" href="/_nuxt/28525bf520ad9181cd06.css" as="style">
feature request

Most helpful comment

Same problem here, LightHouse tells there're 7.34s estimated savings 馃槻 All .css vuetify files.

All 20 comments

@jackie-park Not sure what you're going to achieve, I think you shouldn't have to preload it, it seems to be related to https://github.com/nuxt-community/vuetify-module/issues/143, components in Nuxt pages aren't preloaded with SSR but should be, if i'm right.

Any news @jackie-park ?

@jackie-park Vuetify theme css seems to be already preloaded when using SSR

image
image

I don't know how to preload this. Thanks.

Are you using SSR/SPA ? Static generation ?

I am using SPA.

I just think this file can't be preloaded, it is added at runtime by Nuxt when loading the page components.

I have the same issue.
image

I think it's cause vuetify-loader doesn't lazy load components.
WIth #154 manual mode, people will be able to manually import Vuetify components everywhere and lazy load them. Which means that if there's still issue about preload, it's a Nuxt issue and not Vuetify module one.

I'm closing it in favor of #154 on which I'm working on right now

@jackie-park did you find any solution for this? i'm using nuxt generate and run into the same problem.

Same issue for me, this greatly impacts things like PageSpeed scores.

@kevinmarrec Did you come across a solution?
This is really impacting lighthouse audits
image

Additionally in the request chaining section as well
image

No solutions for this but I did some work for performance.
MinifyTheme, Preconnect, Flattening static folders, webfontloader, display swap for text, display block for icon and so on

Same problem here, LightHouse tells there're 7.34s estimated savings 馃槻 All .css vuetify files.

Me too. This is seriously hurting my LightHouse score.

+1

I'm experiencing the same issue, anyone got a workaround?

Facing same issue. Looking for a solution for this.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

berenicestr picture berenicestr  路  5Comments

avanishp2 picture avanishp2  路  3Comments

robsontenorio picture robsontenorio  路  6Comments

Ghalnas picture Ghalnas  路  4Comments

MartinMuzatko picture MartinMuzatko  路  4Comments