Skip to content

What is the best way to preload my chunked CSS? #2125

Closed
@jameshibbard

Description

@jameshibbard

I'm currently running my Rails/Vue app through Google's PageSpeed Insights and it's telling me I could shave off a reasonable amount of time (on mobile) if I preload my chunked CSS.

It says:

Consider using <link rel=preload> to prioritize fetching resources that are currently requested later in page load
URL: …css/below-fold-369ba11f.chunk.css

It seems webpack 4.6.0 adds support for preloading using a magic comment:

import(/* webpackPreload: true */ "...")

However, the latest version of webpacker uses webpack 4.33.

What is the best way to implement this using the current version of webpacker? I'd be grateful for a pointer in the right direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions