Skip to content

Css font imports in manifest.json #18392

Open
@indykoning

Description

@indykoning

Description

Currently fonts are properly added to the manifest.json but you cannot see which e.g. css/vue files require this font.
This makes automatic preloading difficult as we cannot determine which file requires the font, and IF we need to require the font for the initial page load.

https://stackblitz.com/edit/github-citlf9?file=package.json,src%2Findex.css&terminal=build

Suggested solution

I suggest adding an imports key to css files within the manifest.json just like is done with JS.
This may contain imported css (which is not relevant as everything currently gets compiled to a single css file)
and fonts required by the current css or vue file.

This way when (pre)loading the css or vue file, we know we should also (pre)load those font files

Alternative

Preloading of the fonts either needs to be done manually, or ALL fonts in the manifest.json must be loaded. Which isn't ideal since likely not all fonts are actually used on the current page.

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions