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

feature: pass options object (optional) && sync css asset load option #4

Merged
merged 6 commits into from
May 17, 2022

Conversation

borkeszmate
Copy link
Collaborator

@borkeszmate borkeszmate commented May 17, 2022

  • Pass options object as parameter to plugin in ViteWebfontDownload() entrypoint function
  • async option: prevent the usage of inline event handlers that can cause Content Security Policy issues

Options object

Usage:

ViteWebfontDownload(
 [
  'https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap'
 ],
 {
  async: false
 }
)

or:

ViteWebfontDownload(
 {
  async: false
 }
)

Sync css asset load option:

**Async: ** (default)

<link rel="stylesheet" media="print" onload="this.onload=null;this.removeAttribute('media');" href="/assets/webfonts.6c7e5154.css">

Sync:

<link rel="stylesheet" href="/assets/webfonts.6c7e5154.css">

Máté Borkesz added 5 commits May 17, 2022 11:45
@0xb4lint 0xb4lint merged commit e0e057c into feat-agency:master May 17, 2022
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

Successfully merging this pull request may close these issues.

2 participants