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

fix: add pre-connect directive in umami plugin and fix documentation for umami in readme #431

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ VITE_GRAASP_API_HOST=http://localhost:3000
VITE_GRAASP_AUTH_HOST=http://localhost:3001
VITE_SHOW_NOTIFICATIONS=true

UMAMI_WEBSITE_ID=<the id of your umami project>
VITE_UMAMI_WEBSITE_ID=<the id of your umami project>
VITE_UMAMI_HOST=http://localhost:8000
```
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
<link rel="mask-icon" href="/safari-pinned-tab.svg?v=1" color="#f2c955" />
<link rel="shortcut icon" href="/favicon.ico?v=1" />
<meta name="msapplication-TileColor" content="#f2c955" />

<!-- Add pre-connect directive to improve performance when fetching data from google fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<!-- Load Roboto font from Google fonts -->
<link
rel="stylesheet"
Expand Down
7 changes: 7 additions & 0 deletions umami.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ export default function umamiPlugin(options: UmamiPluginOptions): Plugin {
}

return [
{
tag: 'link',
attrs: {
rel: 'preconnect',
href: options.host,
},
},
{
tag: 'script',
attrs: {
Expand Down