Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Offload Fonts To Custom Storage Handler #155

Open
harlan-zw opened this issue Feb 1, 2024 · 1 comment
Open

Offload Fonts To Custom Storage Handler #155

harlan-zw opened this issue Feb 1, 2024 · 1 comment

Comments

@harlan-zw
Copy link
Collaborator

With #151 we move fonts to Nitro's Server Assets, this solves several issues of making fetch requests at rutime.

However, this always bundles the font files, which is an issue on edge runtimes that have limited size constraints (vercel gives 2mb).

We need to offload the fonts to a custom storage driver that the end user would provide.

@ptdev
Copy link

ptdev commented Apr 2, 2024

Hi, I came across this as well.

We are not using dynamic og image/text generation (we have ready made images) but the bundle always includes the Inter font which increases the bundle size tremendously.

And, even if we select another font on nuxt config (as described in the docs) it then apparently includes both the selected font and also the Inter font. (see attached screenshots, one with default configuration that includes the huge Inter font, and another one where I've selected the Poppins font on nuxt config but where it still includes the Inter font in the server bundle anyway, even though the documentation states that if we select another font on nuxt config then the Inter font will be disabled)

I suggest that it should be possible to (for example) set the fonts parameter on nuxt config to false to prevent including any fonts at all for these cases where dynamic image/text generation is not required.

Cheers.

Screenshot 2024-04-02 at 09 54 48 Screenshot 2024-04-02 at 09 55 08

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants